Skip to content

Commit

Permalink
turn on:click into arrow function, hopefully fixes #8, add alerts to …
Browse files Browse the repository at this point in the history
…mock power menu
  • Loading branch information
hertg committed Oct 15, 2022
1 parent 82fcdb7 commit 6d52b17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/PowerMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
<Container>
<div class="container">
{#if window.lightdm.can_hibernate}
<BigButton icon="Moon24" text="Hibernate" on:click={window.lightdm.hibernate} />
<BigButton icon="Moon24" text="Hibernate" on:click={() => window.lightdm.hibernate()} />
{/if}

{#if window.lightdm.can_suspend}
<BigButton icon="NoEntry24" text="Suspend" on:click={window.lightdm.suspend} />
<BigButton icon="NoEntry24" text="Suspend" on:click={() => window.lightdm.suspend()} />
{/if}

{#if window.lightdm.can_restart}
<BigButton icon="Sync24" text="Restart" on:click={window.lightdm.restart} />
<BigButton icon="Sync24" text="Restart" on:click={() => window.lightdm.restart()} />
{/if}

{#if window.lightdm.can_shutdown}
<BigButton icon="Plug24" text="Shutdown" on:click={window.lightdm.shutdown} />
<BigButton icon="Plug24" text="Shutdown" on:click={() => window.lightdm.shutdown()} />
{/if}
</div>
</Container>
Expand Down
4 changes: 4 additions & 0 deletions src/utils/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,19 @@ export class Greeter implements GreeterClass {
}

hibernate() {
alert('hibernate');
return true;
}
restart() {
alert('restart');
return true;
}
shutdown() {
alert('shutdown')
return true;
}
suspend() {
alert('suspend');
return true;
}
respond(response: string) {
Expand Down

0 comments on commit 6d52b17

Please sign in to comment.