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

[Bug] 无法编辑之前创建的面具 #2359

Closed
3 tasks done
imldy opened this issue Jul 11, 2023 · 1 comment
Closed
3 tasks done

[Bug] 无法编辑之前创建的面具 #2359

imldy opened this issue Jul 11, 2023 · 1 comment

Comments

@imldy
Copy link
Contributor

imldy commented Jul 11, 2023

请在下方中括号内输入 x 来表示你已经知晓相关内容。

  • 我确认已经在 常见问题 中搜索了此次反馈的问题,没有找到解答;
  • 我确认已经在 Issues 列表(包括已经 Close 的)中搜索了此次反馈的问题,没有找到解答。
  • 我确认已经在 Vercel 使用教程 中搜索了此次反馈的问题,没有找到解答。

描述问题

旧面具的”编辑“按钮被点击后无反应

但是新建的面具可以编辑。

查阅代码后,推测是面具id迁移为nanoid( 8e4743e )后,旧面具对象的key仍然为数字id,造成面具id!=面具对象key,无法通过面具id获取到面具对象,进而无法打开编辑窗口。

https://github.com/Yidadaa/ChatGPT-Next-Web/blob/c44454bf744ce7b23430c9145365440079fdc3d8/app/store/mask.ts#L85-L87

面具id迁移为nanoid后的Local Storage.mask-store

{
    "state": {
        "masks": {
            "1": {
                "id": "mpJMUA7p5QhhRsGhJZjad" //其他属性省略
            }
        },
        "globalMaskId": 4
    },
    "version": 3
}

需要再次迁移,使面具对象key=面具id。

如何复现

点击旧面具的”编辑“按钮。

截图

image

控制台无输出。

一些必要的信息

  • 系统:windows 11
  • 浏览器:chrome
  • 版本: 2.8.9
  • 部署方式:vercel
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] Unable to edit previously created masks

Please enter x in the square brackets below to indicate that you already know the relevant content.

  • I confirm that I have searched for this feedback issue in FAQ, no answer found;
  • I confirm that I have searched for this feedback issue in the Issues list (including those that have been closed), but have not found an answer.
  • I confirm that I have searched for this feedback issue in Vercel Tutorial , did not find an answer.

Describe problem

The "Edit" button of the old mask does not respond after being clicked

But newly created masks can be edited.

After checking the code, it is speculated that after the mask id is migrated to nanoid (8e4743e ), the key of the old mask object is still a digital id, causing the mask id != mask The object key, the mask object cannot be obtained through the mask id, and the editing window cannot be opened.

https://github.com/Yidadaa/ChatGPT-Next-Web/blob/c44454bf744ce7b23430c9145365440079fdc3d8/app/store/mask.ts#L85-L87

Local Storage.mask-store after the mask id is migrated to nanoid:

{
    "state": {
        "masks": {
            "1": {
                "id": "mpJMUA7p5QhhRsGhJZjad" //other attributes omitted
            }
        },
        "globalMaskId": 4
    },
    "version": 3
}

Need to migrate again, make mask object key = mask id.

How ​​to reproduce

Click the "Edit" button for the old mask.

screenshot

image

There is no output to the console.

some necessary information

  • System: windows 11
  • Browser: chrome
  • Version: 2.8.9
  • Deployment method: vercel

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

No branches or pull requests

2 participants