Allow back button to remove debug log filter.

This commit is contained in:
lisa-signal
2025-08-08 14:18:33 -04:00
committed by Greyson Parrelli
parent 1edc94d5ad
commit 75df8c0e2a
2 changed files with 17 additions and 17 deletions

View File

@@ -275,6 +275,8 @@ public class SubmitDebugLogActivity extends BaseActivity {
warningButton.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.signal_background_secondary)));
errorButton.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.signal_background_secondary)));
uncaughtButton.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.signal_background_secondary)));
DebugLogsViewer.onFilterLevel(logWebView, "[]");
}
@Override

View File

@@ -58,8 +58,8 @@ let selectedLevels = []; // Log levels that are selected in checkboxes
let markers = []; // IDs of highlighted search markers
let matchRanges = []; // Ranges of all search matches
let matchCount = 0; // Total number of matches
let isCaseSensitive = false;
let isFiltered = false;
let isCaseSensitive = false;
// Clear all search markers and match info
function clearMarkers() {
@@ -162,24 +162,22 @@ function onFilter() {
}
function onFilterClose() {
isFiltered = false;
clearMarkers();
editor.getSelection().clearSelection();
if (isFiltered) {
isFiltered = false;
if (selectedLevels.length === 0) {
editor.setValue(logLines, -1);
} else {
const filtered = logLines
.split("\n")
.filter((line) => {
return selectedLevels.some((level) => line.includes(level));
})
.join("\n");
if (selectedLevels.length === 0) {
editor.setValue(logLines, -1);
} else {
const filtered = logLines
.split("\n")
.filter((line) => {
return selectedLevels.some((level) => line.includes(level));
})
.join("\n");
editor.setValue(filtered, -1);
editor.setValue(filtered, -1);
}
highlightAllMatches(input);
}
highlightAllMatches(input);
}