Skip to content

Commit b372558

Browse files
clubby789shepmaster
authored andcommitted
Update URL after saving Gist
1 parent cb8fda6 commit b372558

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

ui/frontend/Router.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,29 @@ interface Substate {
2020
channel: Channel;
2121
mode: Mode;
2222
edition: Edition;
23+
};
24+
output: {
25+
gist: {
26+
id?: string;
27+
}
2328
}
2429
}
2530

26-
const stateSelector = ({ page, configuration: { channel, mode, edition } }: State): Substate => ({
31+
const stateSelector = ({ page, configuration: { channel, mode, edition}, output }: State): Substate => ({
2732
page,
2833
configuration: {
2934
channel,
3035
mode,
3136
edition,
3237
},
38+
output: {
39+
gist: {
40+
id: output.gist.id,
41+
},
42+
},
3343
});
3444

35-
const stateToLocation = ({ page, configuration }: Substate): Partial<Path> => {
45+
const stateToLocation = ({ page, configuration, output }: Substate): Partial<Path> => {
3646
switch (page) {
3747
case 'help': {
3848
return {
@@ -45,6 +55,7 @@ const stateToLocation = ({ page, configuration }: Substate): Partial<Path> => {
4555
version: configuration.channel,
4656
mode: configuration.mode,
4757
edition: configuration.edition,
58+
gist: output.gist.id,
4859
};
4960
return {
5061
pathname: `/?${qs.stringify(query)}`,

0 commit comments

Comments
 (0)