File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 55 * https://opensource.org/licenses/MIT
66 */
77
8+ import { defaultOption } from "@util/constant/option"
89import BaseDatabase from "./common/base-database"
910import { REMAIN_WORD_PREFIX } from "./common/constant"
1011
@@ -28,7 +29,7 @@ class OptionDatabase extends BaseDatabase {
2829 async getOption ( ) : Promise < Partial < timer . option . AllOption > > {
2930 const data = await this . storage . get ( DB_KEY )
3031 const option = data [ DB_KEY ]
31- if ( ! option ) return { }
32+ if ( ! option ) return defaultOption ( )
3233 return option as Partial < timer . option . AllOption >
3334 }
3435
Original file line number Diff line number Diff line change @@ -40,4 +40,12 @@ export function defaultStatistics(): timer.option.StatisticsOption {
4040 collectSiteName : true ,
4141 countLocalFiles : false
4242 }
43+ }
44+
45+ export function defaultOption ( ) : timer . option . AllOption {
46+ return {
47+ ...defaultPopup ( ) ,
48+ ...defaultAppearance ( ) ,
49+ ...defaultStatistics ( ) ,
50+ }
4351}
You can’t perform that action at this time.
0 commit comments