From 5f70609a8210e00e2b211b38c655f1a61126d275 Mon Sep 17 00:00:00 2001 From: LiRui Date: Wed, 17 May 2023 14:04:21 +0800 Subject: [PATCH] fixed 7736e58 from https://gitee.com/ge-yafang/docs/pulls/18304 modify preferences sample code Signed-off-by: LiRui --- .../reference/apis/js-apis-data-preferences.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md b/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md index e47c9ef193..5dd6258ebf 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md +++ b/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md @@ -197,7 +197,7 @@ import featureAbility from '@ohos.ability.featureAbility'; let context = featureAbility.getContext(); try { - data_preferences.deletePreferences(context, 'mystore', function (err, val) { + data_preferences.deletePreferences(context, 'mystore', function (err) { if (err) { console.info("Failed to delete preferences. code =" + err.code + ", message =" + err.message); return; @@ -216,7 +216,7 @@ import UIAbility from '@ohos.app.ability.UIAbility'; class EntryAbility extends UIAbility { onWindowStageCreate(windowStage) { try { - data_preferences.deletePreferences(this.context, 'mystore', function (err, val) { + data_preferences.deletePreferences(this.context, 'mystore', function (err) { if (err) { console.info("Failed to delete preferences. code =" + err.code + ", message =" + err.message); return; @@ -332,7 +332,7 @@ import featureAbility from '@ohos.ability.featureAbility'; let context = featureAbility.getContext(); try { - data_preferences.removePreferencesFromCache(context, 'mystore', function (err, val) { + data_preferences.removePreferencesFromCache(context, 'mystore', function (err) { if (err) { console.info("Failed to remove preferences. code =" + err.code + ", message =" + err.message); return; @@ -351,7 +351,7 @@ import UIAbility from '@ohos.app.ability.UIAbility'; class EntryAbility extends UIAbility { onWindowStageCreate(windowStage) { try { - data_preferences.removePreferencesFromCache(this.context, 'mystore', function (err, val) { + data_preferences.removePreferencesFromCache(this.context, 'mystore', function (err) { if (err) { console.info("Failed to remove preferences. code =" + err.code + ", message =" + err.message); return; -- GitLab