Browse Source

ignore errors

Gildas 11 tháng trước cách đây
mục cha
commit
9a6fb708c1
1 tập tin đã thay đổi với 18 bổ sung8 xóa
  1. 18 8
      src/ui/bg/ui-menus.js

+ 18 - 8
src/ui/bg/ui-menus.js

@@ -612,18 +612,28 @@ async function updateVisibleValue(tab, visible) {
 	}
 }
 
-function updateTitleValue(id, title) {
+async function updateTitleValue(id, title) {
 	const lastTitleValue = menusTitleState.get(id);
-	menusTitleState.set(id, title);
-	if (lastTitleValue === undefined) {
-		return menus.update(id, { title });
-	} else if (lastTitleValue != title) {
-		return menus.update(id, { title });
+	try {
+		if (lastTitleValue === undefined) {
+			await menus.update(id, { title });
+		} else if (lastTitleValue != title) {
+			await menus.update(id, { title });
+		}
+		menusTitleState.set(id, title);
+		// eslint-disable-next-line no-unused-vars
+	} catch (error) {
+		// ignored
 	}
 }
 
 async function updateCheckedValue(id, checked) {
 	checked = Boolean(checked);
-	menusCheckedState.set(id, checked);
-	await menus.update(id, { checked });
+	try {
+		await menus.update(id, { checked });
+		menusCheckedState.set(id, checked);
+		// eslint-disable-next-line no-unused-vars
+	} catch (error) {
+		// ignored
+	}
 }