Skip to content

Commit

Permalink
feat: Remove rich-black theme
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmilton committed Jun 28, 2024
1 parent 377615b commit d07bdd9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
14 changes: 0 additions & 14 deletions src/css/themes/rich-black.xcss

This file was deleted.

1 change: 0 additions & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ const meta = compile(`
<select @theme>
<option value=light>Light</option>
<option value=dark>Dark</option>
<option value=rich-black>Rich Black</option>
<option value=hacker-blue>Hacker Blue</option>
<option value=hacker-pink>Hacker Pink</option>
<option value=hacker-terminal>Hacker Terminal</option>
Expand Down
11 changes: 11 additions & 0 deletions src/sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ chrome.runtime.onInstalled.addListener(async () => {
(res) => res.json() as Promise<ThemesData>,
);
const settings: Promise<UserStorageData> = chrome.storage.local.get();

// TODO: Remove once most users have updated.
// Migrate users on old rich-dark theme (removed in v0.23.0)
if ((await settings).tn === 'rich-dark') {
void chrome.storage.local.set({
t: (await themes).dark,
tn: 'dark',
});
return;
}

void chrome.storage.local.set({
t: (await themes)[(await settings).tn ?? 'dark'],
});
Expand Down
2 changes: 1 addition & 1 deletion test/unit/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('dist files', () => {
['settings.css', 'text/css;charset=utf-8', 1000, 1500],
['settings.html', 'text/html;charset=utf-8', 150, 200],
['settings.js', 'text/javascript;charset=utf-8', 4000, 6000],
['sw.js', 'text/javascript;charset=utf-8', 150, 250],
['sw.js', 'text/javascript;charset=utf-8', 150, 300],
['themes.json', 'application/json;charset=utf-8'],
];

Expand Down

0 comments on commit d07bdd9

Please sign in to comment.