list_edit: setListAccounts() is never an Promise<>, So don't need to use .then() #3481

Merged
hj merged 1 commit from Yonle/pleroma-fe:list_edit_fix-1 into develop 2026-03-02 21:11:57 +00:00
Member

in src/stores/lists.js:

    setListAccounts({ listId, accountIds }) {
      const saved = this.allListsObject[listId]?.accountIds || []
      const added = accountIds.filter((id) => !saved.includes(id))
      const removed = saved.filter((id) => !accountIds.includes(id))
      if (!this.allListsObject[listId]) {
        this.allListsObject[listId] = { accountIds: [] }
      }
      this.allListsObject[listId].accountIds = accountIds
      if (added.length > 0) {
        window.vuex.state.api.backendInteractor.addAccountsToList({
          listId,
          accountIds: added,
        })
      }
      if (removed.length > 0) {
        window.vuex.state.api.backendInteractor.removeAccountsFromList({
          listId,
          accountIds: removed,
        })
      }
    }

this function is never an Promise. The code in src/components/list_edit.js treated it as a Promise, which then yield an error:
image

this PR fixes it by not treating it as an Promise, making list creation / edit work properly again.

in `src/stores/lists.js`: ```js setListAccounts({ listId, accountIds }) { const saved = this.allListsObject[listId]?.accountIds || [] const added = accountIds.filter((id) => !saved.includes(id)) const removed = saved.filter((id) => !accountIds.includes(id)) if (!this.allListsObject[listId]) { this.allListsObject[listId] = { accountIds: [] } } this.allListsObject[listId].accountIds = accountIds if (added.length > 0) { window.vuex.state.api.backendInteractor.addAccountsToList({ listId, accountIds: added, }) } if (removed.length > 0) { window.vuex.state.api.backendInteractor.removeAccountsFromList({ listId, accountIds: removed, }) } } ``` this function is never an Promise. The code in `src/components/list_edit.js` treated it as a Promise, which then yield an error: ![image](/attachments/86cb1b72-949a-41a6-b131-eb5c0d3698d3) this PR fixes it by not treating it as an Promise, making list creation / edit work properly again.
332 KiB
hj merged commit a9a86bdbdc into develop 2026-03-02 21:11:57 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/pleroma-fe!3481
No description provided.