Skip to content

Commit

Permalink
fix: don't copy link on page load
Browse files Browse the repository at this point in the history
  • Loading branch information
adalinesimonian committed Jan 28, 2024
1 parent 760b6ee commit bdc528c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/statusbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class Statusbar extends StateManagedElement {
this.appStateManager.emit('request-node-positions');
});

this.appStateManager.observe('nodePositions', (nodePositions) => {
this.appStateManager.on('node-positions', () => {
const url = new URL(window.location.href);
url.search = this.appStateManager.serialize(true);
navigator.clipboard.writeText(url.toString());
Expand Down
2 changes: 1 addition & 1 deletion src/providers/app-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
* App event.
*/
export type AppEvent = {
name: 'reload' | 'start-sim' | 'request-node-positions';
name: 'reload' | 'start-sim' | 'request-node-positions' | 'node-positions';
args: [];
};
1 change: 1 addition & 0 deletions src/rendering/graph-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export class GraphView extends EventTarget {
);
});
this.#appStateManager.set('nodePositions', nodePositions);
this.#appStateManager.emit('node-positions');
});
}

Expand Down

0 comments on commit bdc528c

Please sign in to comment.