Skip to content

Commit 48188dc

Browse files
Prevent bug in app when not in /app folder
The app can be installed in arbitrary folders (like /custom_apps). This will break when the URL is hardcoded. This fix should make the URL dynamic with the NC core JS functions. Signed-off-by: Christian Wolf <[email protected]> # Conflicts: # src/components/RecipeTimer.vue
1 parent 0785166 commit 48188dc

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

assets/alarm-continuous.mp3

37 KB
Binary file not shown.

src/components/RecipeTimer.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,10 @@
1212
</template>
1313

1414
<script>
15-
16-
// Source for the sound https://pixabay.com/sound-effects/alarm-clock-short-6402/
17-
// Voted by poll https://nextcloud.christian-wolf.click/nextcloud/apps/polls/s/Wke3s6CscDwQEjPV
18-
import alarmSound from "../media/alarm-clock-short-6402.mp3"
15+
import { linkTo } from "@nextcloud/router"
1916
2017
import { showSimpleAlertModal } from "cookbook/js/modals"
2118
22-
2319
export default {
2420
name: "RecipeTimer",
2521
props: {
@@ -71,7 +67,13 @@ export default {
7167
this.resetTimeDisplay()
7268
// Start loading the sound early so it's ready to go when we need to
7369
// play it
74-
this.audio = new Audio(alarmSound)
70+
71+
// Source for the sound https://pixabay.com/sound-effects/alarm-clock-short-6402/
72+
// Voted by poll https://nextcloud.christian-wolf.click/nextcloud/apps/polls/s/Wke3s6CscDwQEjPV
73+
this.audio = new Audio(
74+
linkTo("cookbook", "assets/alarm-continuous.mp3")
75+
)
76+
7577
// For now, the alarm should play continuously until it is dismissed
7678
// See https://github.com/nextcloud/cookbook/issues/671#issuecomment-1279030452
7779
this.audio.loop = true

src/media/alarm-clock-short-6402.mp3

-168 KB
Binary file not shown.

0 commit comments

Comments
 (0)