-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #581 from arconnectio/fix/placeholder-issue
fix: resolve issue with placeholder & related code
- Loading branch information
Showing
9 changed files
with
122 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import browser from "webextension-polyfill"; | ||
import { ExtensionStorage } from "~utils/storage"; | ||
|
||
export const ARCONNECT_THEME_BACKGROUND_COLOR = | ||
"ARCONNECT_THEME_BACKGROUND_COLOR"; | ||
export const ARCONNECT_THEME_TEXT_COLOR = "ARCONNECT_THEME_TEXT_COLOR"; | ||
|
||
/** | ||
* Clear all storage keys except for gateways. | ||
*/ | ||
export async function resetStorage() { | ||
if (typeof localStorage !== "undefined") { | ||
localStorage.removeItem(ARCONNECT_THEME_BACKGROUND_COLOR); | ||
localStorage.removeItem(ARCONNECT_THEME_TEXT_COLOR); | ||
} | ||
|
||
try { | ||
// get all keys except gateways | ||
const allStoredKeys = Object.keys( | ||
(await browser.storage.local.get(null)) || {} | ||
).filter((key) => key !== "gateways"); | ||
|
||
// remove all keys except gateways | ||
await Promise.allSettled( | ||
allStoredKeys.map((key) => ExtensionStorage.remove(key)) | ||
); | ||
} catch {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters