Skip to content

Commit

Permalink
Merge pull request #320 from Outblock/dev
Browse files Browse the repository at this point in the history
Merge to master - Small fix for storage warning
  • Loading branch information
tombeckenham authored Dec 20, 2024
2 parents 995aaad + 74922c6 commit f5953a7
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 3 deletions.
3 changes: 3 additions & 0 deletions _raw/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,9 @@
"message": "Import Profile"
},
"Insufficient_Storage": {
"message": "Insufficient storage."
},
"Almost_run_out_of_account_storage": {
"message": "Almost run out of account storage."
},
"Insufficient_storage_after_action": {
Expand Down
3 changes: 3 additions & 0 deletions _raw/_locales/ja/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,9 @@
"message": "プロファイルをインポート"
},
"Insufficient_Storage": {
"message": "ストレージが不足しています"
},
"Almost_run_out_of_account_storage": {
"message": "アカウントのストレージが不足しています"
},
"Transaction_failed_storage_exceeded": {
Expand Down
3 changes: 3 additions & 0 deletions _raw/_locales/ru/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,9 @@
"message": "Импортировать профиль"
},
"Insufficient_Storage": {
"message": "Недостаточно памяти"
},
"Almost_run_out_of_account_storage": {
"message": "В вашем аккаунте недостаточно места для хранения данных"
},
"Transaction_failed_storage_exceeded": {
Expand Down
3 changes: 3 additions & 0 deletions _raw/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,9 @@
"message": "导入账户"
},
"Insufficient_Storage": {
"message": "存储不足"
},
"Almost_run_out_of_account_storage": {
"message": "帐户存储空间几乎耗尽"
},
"Transaction_failed_storage_exceeded": {
Expand Down
10 changes: 8 additions & 2 deletions src/background/service/news.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ class NewsService {
const filteredNewsPromises = news
.filter((n) => !this.isDismissed(n.id))
.map(async (newsItem) => {
const shouldShow = await conditionsEvaluator.evaluateConditions(newsItem.conditions);
return shouldShow ? newsItem : null;
try {
const shouldShow = await conditionsEvaluator.evaluateConditions(newsItem.conditions);
return shouldShow ? newsItem : null;
} catch (error) {
// Catch error here otherwise the whole news list will be empty
console.error('Error evaluating conditions', error);
return null;
}
});
const filteredNews = await Promise.all(filteredNewsPromises)
.catch((error) => {
Expand Down
3 changes: 3 additions & 0 deletions src/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,9 @@
"message": "Import Profile"
},
"Insufficient_Storage": {
"message": "Insufficient storage."
},
"Almost_run_out_of_account_storage": {
"message": "Almost run out of account storage."
},
"Transaction_failed_storage_exceeded": {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/FRWComponent/WarningStorageLowSnackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const WarningStorageLowSnackbar = ({
isLowStorageAfterAction,
}: WarningStorageLowSnackbarProps = {}) => {
const message = isLowStorage
? chrome.i18n.getMessage('Insufficient_storage')
? chrome.i18n.getMessage('Almost_run_out_of_account_storage')
: isLowStorageAfterAction
? chrome.i18n.getMessage('Insufficient_storage_after_action')
: undefined;
Expand Down

0 comments on commit f5953a7

Please sign in to comment.