release 1.3.1
This commit is contained in:
@@ -6,8 +6,8 @@ import { preferences } from '@kit.ArkData';
|
||||
struct WidgetSettings {
|
||||
@State selectedStyle: string = 'classic';
|
||||
@State showTime: boolean = true;
|
||||
@State showWeather: boolean = true;
|
||||
@State showQuote: boolean = true;
|
||||
@State showWeather: boolean = false;
|
||||
@State showQuote: boolean = false;
|
||||
@State quoteText: string = '床前明月光,疑是地上霜。';
|
||||
@State authorText: string = '李白《静夜思》';
|
||||
private preference: preferences.Preferences | null = null;
|
||||
@@ -26,11 +26,11 @@ struct WidgetSettings {
|
||||
this.showTime = Boolean(showTimeVal);
|
||||
console.info('[WidgetSettings] showTime raw value: ' + showTimeVal + ', type: ' + typeof showTimeVal + ', parsed: ' + this.showTime);
|
||||
|
||||
const showWeatherVal = await this.preference.get('showWeather', true);
|
||||
const showWeatherVal = await this.preference.get('showWeather', false);
|
||||
this.showWeather = Boolean(showWeatherVal);
|
||||
console.info('[WidgetSettings] showWeather raw value: ' + showWeatherVal + ', type: ' + typeof showWeatherVal + ', parsed: ' + this.showWeather);
|
||||
|
||||
const showQuoteVal = await this.preference.get('showQuote', true);
|
||||
const showQuoteVal = await this.preference.get('showQuote', false);
|
||||
this.showQuote = Boolean(showQuoteVal);
|
||||
|
||||
this.quoteText = await this.preference.get('quote', '床前明月光,疑是地上霜。') as string;
|
||||
|
||||
Reference in New Issue
Block a user