File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 3232
3333 // svelte变量
3434 let storage = localStorage .discuss
35+ let draft = localStorage .getItem (' discuss:draft' )
3536 let isEmot = false
3637 let emotIndex = 0
3738 let emotMaps = {}
8687 function initInfo () {
8788 try {
8889 storage = JSON .parse (storage) || {}
90+ draft = JSON .parse (draft) || {}
91+
8992 for (const [k , v ] of Object .entries (storage)) {
9093 metas[k].value = v || ' '
9194 }
95+
96+ metas .content .value = draft[D .path ]? .content || ' '
9297 } catch (error) {
9398 storage = {}
99+ draft = {}
94100 }
95101 }
96102
140146 storage[k] = v .value .trim ()
141147 }
142148 localStorage .discuss = JSON .stringify (storage)
149+
150+ draft[D .path ] = {}
151+ draft[D .path ].content = metas .content .value
152+ localStorage .setItem (' discuss:draft' , JSON .stringify (draft))
153+
143154 // 重新解析表情
144155 parseEmot ()
145156 }
514525
515526 & : hover {
516527 background: var (-- D - Low- Color);
517- box-shadow : 0 2px 2px 0 rgb (0 0 0 / 14% ), 0 3px 1px -2px rgb (0 0 0 / 20% ), 0 1px 5px 0 rgb (0 0 0 / 12% );
528+ box- shadow:
529+ 0 2px 2px 0 rgb (0 0 0 / 14 % ),
530+ 0 3px 1px - 2px rgb (0 0 0 / 20 % ),
531+ 0 1px 5px 0 rgb (0 0 0 / 12 % );
518532 }
519533 }
520534
You can’t perform that action at this time.
0 commit comments