Skip to content

Commit

Permalink
Change the sidebar filter to match new patch state
Browse files Browse the repository at this point in the history
When changing the state of a patch we want the sidebar filter to reflect
that, otherwise the patch just disappears from the sidebar unless the
user selected "show all states".
  • Loading branch information
rudolfs committed Jan 9, 2025
1 parent 4272690 commit ff8b133
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/views/repo/Patch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,20 @@
}
/* eslint-disable prefer-const */
let { repo, patch, patches, revisions, config, status }: Props = $props();
let {
repo,
patch,
patches,
revisions,
config,
status: initialStatus,
}: Props = $props();
/* eslint-enable prefer-const */
let cursor = patches.cursor;
let more = patches.more;
let items = $state(patches.content);
let status = $state(initialStatus);
let editingTitle = $state(false);
let updatedTitle = $state("");
let labelSaveInProgress: boolean = $state(false);
Expand Down Expand Up @@ -238,6 +246,9 @@
},
opts: { announce: $nodeRunning && $announce },
});
if (initialStatus !== undefined) {
status = state["status"];
}
} catch (error) {
console.error("Changing patch state failed", error);
} finally {
Expand Down

0 comments on commit ff8b133

Please sign in to comment.