aboutsummaryrefslogtreecommitdiff
path: root/src/background
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2020-05-04 17:50:42 +0900
committerGitHub <noreply@github.com>2020-05-04 17:50:42 +0900
commit69b6894b1997a773678709a7cd591afddc15c8ce (patch)
tree07e4c665829236e733316ae6f2684fe03b0a6781 /src/background
parent49addd75b76f185c9dad5d74e44e39cbea360510 (diff)
parent44ff8e449dba0de32500da3c3f17fc1361449717 (diff)
Merge pull request #751 from ueokande/dark-mode
Supports dark mode
Diffstat (limited to 'src/background')
-rw-r--r--src/background/controllers/CompletionController.ts4
-rw-r--r--src/background/repositories/CachedSettingRepository.ts13
2 files changed, 15 insertions, 2 deletions
diff --git a/src/background/controllers/CompletionController.ts b/src/background/controllers/CompletionController.ts
index 35538be..b00a0cb 100644
--- a/src/background/controllers/CompletionController.ts
+++ b/src/background/controllers/CompletionController.ts
@@ -4,7 +4,7 @@ import {
ConsoleRequestBookmarksResponse,
ConsoleRequestHistoryResponse,
ConsoleRequestSearchEnginesResponse,
- ConsoleRequesttabsResponse,
+ ConsoleRequestTabsResponse,
} from "../../shared/messages";
import { injectable } from "tsyringe";
import OpenCompletionUseCase from "../completion/OpenCompletionUseCase";
@@ -43,7 +43,7 @@ export default class CompletionController {
async queryTabs(
query: string,
excludePinned: boolean
- ): Promise<ConsoleRequesttabsResponse> {
+ ): Promise<ConsoleRequestTabsResponse> {
return this.tabCompletionUseCase.queryTabs(query, excludePinned);
}
diff --git a/src/background/repositories/CachedSettingRepository.ts b/src/background/repositories/CachedSettingRepository.ts
index e3d3950..b4cdd1c 100644
--- a/src/background/repositories/CachedSettingRepository.ts
+++ b/src/background/repositories/CachedSettingRepository.ts
@@ -1,6 +1,7 @@
import MemoryStorage from "../infrastructures/MemoryStorage";
import Settings from "../../shared/settings/Settings";
import Properties from "../../shared/settings/Properties";
+import ColorScheme from "../../shared/ColorScheme";
const CACHED_SETTING_KEY = "setting";
@@ -56,6 +57,18 @@ export class CachedSettingRepositoryImpl implements CachedSettingRepository {
case "complete":
current.properties.complete = newValue as string;
break;
+ case "colorscheme": {
+ switch (newValue) {
+ case ColorScheme.Light:
+ case ColorScheme.Dark:
+ case ColorScheme.System:
+ current.properties.colorscheme = newValue as ColorScheme;
+ break;
+ default:
+ throw new Error(`Unsupported colorscheme: ${newValue}`);
+ }
+ break;
+ }
}
await this.update(current);
}