Browse Source

Fix issues preventing building

master
David Ludwig 4 years ago
parent
commit
4df46b5f62
4 changed files with 10 additions and 18 deletions
  1. +5
    -5
      src/app/components/AppModals.vue
  2. +4
    -2
      src/app/components/modals/MovieModal.vue
  3. +0
    -10
      src/app/store/index.ts
  4. +1
    -1
      src/app/views/Search.vue

+ 5
- 5
src/app/components/AppModals.vue View File

@ -23,19 +23,19 @@ export default defineComponent({
modalClicked() {
console.log("Modal clicked");
},
...mapMutations({
hide: Mutation.ModalHide
})
// ...mapMutations({
// hide: Mutation.ModalHide
// })
},
mounted() {
document.addEventListener("keydown", (event: KeyboardEvent) => {
if (event.key != "Escape") {
return;
}
this.hide();
// this.hide();
});
}
})
});
</script>
<style lang="postcss">


+ 4
- 2
src/app/components/modals/MovieModal.vue View File

@ -119,7 +119,8 @@ export default defineComponent({
this.computeBackdropColor();
},
computeBackdropColor() {
let rgb: {r: number, g: number, b: number};
// This is being weird and this is the only way I can fix it...
let rgb: {[k: string]: number} = {r: 0, g: 0, b: 0};
try {
rgb = getAverageRgb(<HTMLImageElement>this.$refs["poster"]);
} catch(e) {
@ -137,7 +138,8 @@ export default defineComponent({
for (let k in rgb) {
rgb[k] *= 0.90;
}
this.rgb = rgb;
this.rgb = <any>rgb;
},
async fetchMovieDetails() {
let response = <movie> await (authFetch(`/api/movie/details/${this.movieId}`).then(response => response.json()));


+ 0
- 10
src/app/store/index.ts View File

@ -34,13 +34,3 @@ export function useStore() {
* Export the store instance by default
*/
export default store;
import {Mutation} from "./mutations";
import Modal from "@app/components/modals";
(<any>window).modalShow = (name: Modal) => {
store.commit(Mutation.ModalShow, name);
}
(<any>window).modalHide = () => {
store.commit(Mutation.ModalHide, undefined);
}

+ 1
- 1
src/app/views/Search.vue View File

@ -1,5 +1,5 @@
<template>
<form @submit.prevent="search">
<form @submit.prevent="() => search()">
<div class="flex rounded-xl overflow-hidden shadow-md mb-8">
<input type="text" v-model="searchValue" :placeholder="exampleTitles[Math.floor(exampleTitles.length*Math.random())]"
class="w-full outline-none p-2 bg-white border border-gray-100 text-gray-800 placeholder-gray-400 disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-gray-50 disabled:border-gray-400">


Loading…
Cancel
Save