Skip to content

Commit

Permalink
fix: correct migration for issues in v4
Browse files Browse the repository at this point in the history
- (migration) info should be optional
  • Loading branch information
cecilia-sanare committed Jun 27, 2024
1 parent 917f29e commit adb6bf7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type Migrations = {
export type Migration<L, T, I = undefined> = {
list: L;
apps: T[];
info: I;
info?: I;
};

export async function migrate(initial: Migration<AppsList, App, Info>) {
Expand Down
6 changes: 5 additions & 1 deletion src/migrations/v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function migrate({
}: Migration<V4.AppsList, V4.App, V4.Info>): Promise<Migration<V3.AppsList, V3.App>> {
return {
list,
apps: apps.map((app) => {
apps: apps.map(({ ...app }) => {
const settings: V3.App['tweaks']['settings'] = {};

if (app.tweaks.env.PROTON_NO_ESYNC) {
Expand All @@ -29,6 +29,10 @@ export async function migrate({

return {
...app,
issues: app.issues.map((issue) => ({
...issue,
solution: issue.solution ?? null,
})),
tweaks: {
...tweaks,
settings,
Expand Down

0 comments on commit adb6bf7

Please sign in to comment.