|
@@ -1,6 +1,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import {onMount} from "svelte";
|
|
import {onMount} from "svelte";
|
|
|
import {enableRecipeMode, disableRecipeMode, attachVisibilityReacquire} from "$lib/wakeLock.js";
|
|
import {enableRecipeMode, disableRecipeMode, attachVisibilityReacquire} from "$lib/wakeLock.js";
|
|
|
|
|
+ import {notify} from "$lib/notifier.svelte.js";
|
|
|
|
|
|
|
|
let {data} = $props();
|
|
let {data} = $props();
|
|
|
let on = $state(false);
|
|
let on = $state(false);
|
|
@@ -9,9 +10,11 @@
|
|
|
if(on){
|
|
if(on){
|
|
|
await disableRecipeMode();
|
|
await disableRecipeMode();
|
|
|
on = false;
|
|
on = false;
|
|
|
|
|
+ notify("success", "Recipe mode on. Screen will not turn off");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
on = await enableRecipeMode();
|
|
on = await enableRecipeMode();
|
|
|
|
|
+ notify("warning", "Recipe mode off.")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMount(()=>{
|
|
onMount(()=>{
|
|
@@ -54,7 +57,7 @@
|
|
|
<a class="button" href="/recipe/{data.recipe.id}/edit">Edit</a>
|
|
<a class="button" href="/recipe/{data.recipe.id}/edit">Edit</a>
|
|
|
<button>Printable PDF</button>
|
|
<button>Printable PDF</button>
|
|
|
<button>Link</button>
|
|
<button>Link</button>
|
|
|
- <button onclick={toggle}>{on ? "Recipe Mode On" : "Recipe Mode Off"}</button>
|
|
|
|
|
|
|
+ <button onclick={toggle}>Recipe Mode</button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|