feat: 拼音描红和默写一
This commit is contained in:
@@ -106,7 +106,7 @@ createPage(
|
||||
const next = !this.data.isPreviewFavorite;
|
||||
this.setData({ isPreviewFavorite: next });
|
||||
const id = this.data.worksheetId;
|
||||
if (id) {
|
||||
if (id && this._favoritedMap) {
|
||||
this._favoritedMap[id] = next;
|
||||
if (next) {
|
||||
addFavorite(id);
|
||||
@@ -124,7 +124,7 @@ createPage(
|
||||
const ids = PINYIN_DICTATION_MODE_OPTIONS.map((d) => d.id);
|
||||
this._favoritedMap = await batchCheckFavorited(ids);
|
||||
const currentId = this.data.worksheetId;
|
||||
if (this._favoritedMap[currentId]) {
|
||||
if (this._favoritedMap?.[currentId]) {
|
||||
this.setData({ isPreviewFavorite: true });
|
||||
}
|
||||
},
|
||||
@@ -145,7 +145,7 @@ createPage(
|
||||
worksheetId,
|
||||
functionId: worksheetId,
|
||||
currentMode: worksheetId as PinyinDictationMode,
|
||||
isPreviewFavorite: !!this._favoritedMap[worksheetId],
|
||||
isPreviewFavorite: !!this._favoritedMap?.[worksheetId],
|
||||
},
|
||||
() => {
|
||||
this.initPageInfo(worksheetId, '拼音字母默写');
|
||||
|
||||
Reference in New Issue
Block a user