Misskey: モバイル版ウィジェットページでウィジェットを削除できない

Created on 22 Jul 2019  ·  4Comments  ·  Source: syuilo/misskey

💡 Summary

タイトル通り

🙂 Expected Behavior

ウィジェットを削除できる

☹️ Actual Behavior

ウィジェットを削除できない

📝 Steps to Reproduce

  1. 何らかの方法でMobile UIを開く
  2. ウィジェットページを開く
  3. ⚙ボタンを押す
  4. どれかウィジェットの×ボタンを押す

📌 Environment

Misskey: 11.26.1
Browser: Chrome 75
OS: macOS 10.14.5

🐛Bug 🖥️Client

Most helpful comment

All 4 comments

×ボタンを押すと, コンソールにエラーでてる

mobile.11.26.0.js:7 TypeError: Cannot use 'in' operator to search for 'Default' in state.settings.mobileHomeProfiles
    at Function.zt [as set] (mobile.11.26.0.js:7)
    at c.removeMobileHomeWidget (mobile.11.26.0.js:37)
    at mobile.11.26.0.js:9
    at mobile.11.26.0.js:15
    at Array.forEach (<anonymous>)
    at mobile.11.26.0.js:15
    at c._withCommit (mobile.11.26.0.js:15)
    at c.commit (mobile.11.26.0.js:15)
    at commit (mobile.11.26.0.js:9)
    at o.removeWidget (63.11.26.0.js:1)

原因はこれじゃないですかね

vue/src/core/observer/index.jsより

  if (key in target && !(key in Object.prototype)) {
    target[key] = val
    return val
  }

あと以下のコードで動くと思います
```js
// src/client/app/store.ts
removeMobileHomeWidget(state, widget) {
state.settings.mobileHomeProfiles[state.device.mobileHomeProfile] = state.settings.mobileHomeProfiles[state.device.mobileHomeProfile].filter(w => w.id != widget.id);
os.store.dispatch('settings/updateMobileHomeProfile');
},

v12 で直っているのでとじます

Was this page helpful?
0 / 5 - 0 ratings