Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: list name is not up-to-date after modification #2797

Merged
merged 1 commit into from Apr 12, 2024

Conversation

lazzzis
Copy link
Contributor

@lazzzis lazzzis commented Apr 12, 2024

Before:

Screen.Recording.2024-04-11.at.7.15.46.PM.mov

As you can see from this screenrecord, the name is always out-of-date.

After:

Screen.Recording.2024-04-11.at.7.16.41.PM.mov

CommonPaginator triggered updateEntry once a new list value is assigned.

function updateEntry(item: any) {
const id = item[keyProp]
const index = items.value.findIndex(i => (i as any)[keyProp] === id)
if (index > -1)
items.value = [...items.value.slice(0, index), preprocess?.([item]) ?? item, ...items.value.slice(index + 1)]

The cancelEdit will trigger a reset but at that time, list.value is still holding an old value. This pr just moves the reset after nextTick to ensure the value is up-to-date.

list.value = await client.v1.lists.$select(form.id).update({
title: form.title,
})
cancelEdit()

Copy link

stackblitz bot commented Apr 12, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Apr 12, 2024

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit 7154984
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/66189bad7ed9dd0008940b06
😎 Deploy Preview https://deploy-preview-2797--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Apr 12, 2024

Deploy Preview for elk-docs canceled.

Name Link
🔨 Latest commit 7154984
🔍 Latest deploy log https://app.netlify.com/sites/elk-docs/deploys/66189bad90d3a700081de879

Copy link
Member

@shuuji3 shuuji3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👍 I confirmed the fix and also compared with main.elk.zone.

@patak-dev patak-dev added this pull request to the merge queue Apr 12, 2024
Merged via the queue into elk-zone:main with commit 2a6a994 Apr 12, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants