Skip to content

Commit

Permalink
chore: minor type improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
phanan committed Sep 5, 2024
1 parent abc7e4e commit 0f3e945
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
exports[`displays nothing if fetching fails 1`] = `<div style="background-image: none;" class="pointer-events-none fixed z-[1000] overflow-hidden opacity-10 bg-cover bg-center top-0 left-0 h-full w-full" data-testid="album-art-overlay"></div>`;

exports[`fetches and displays the album thumbnail 1`] = `<div style="background-image: url(http://test/thumb.jpg);" class="pointer-events-none fixed z-[1000] overflow-hidden opacity-10 bg-cover bg-center top-0 left-0 h-full w-full" data-testid="album-art-overlay"></div>`;

exports[`fetches and displays the album thumbnail 2`] = `<div style="background-image: url(&quot;http://test/thumb.jpg&quot;);" class="pointer-events-none fixed z-[1000] overflow-hidden opacity-10 bg-cover bg-center top-0 left-0 h-full w-full" data-testid="album-art-overlay"></div>`;
1 change: 0 additions & 1 deletion resources/assets/js/composables/useUpload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import isMobile from 'ismobilejs'
import { computed } from 'vue'
import { commonStore } from '@/stores'
import { acceptedMediaTypes } from '@/config'
Expand Down
10 changes: 5 additions & 5 deletions resources/assets/js/services/audioService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export interface Band {
export const audioService = {
unlocked: false,

context: null as unknown as AudioContext,
source: null as unknown as MediaElementAudioSourceNode,
element: null as unknown as HTMLMediaElement,
preampGainNode: null as unknown as GainNode,
analyzer: null as unknown as AnalyserNode,
context: null! as AudioContext,
source: null! as MediaElementAudioSourceNode,
element: null! as HTMLMediaElement,
preampGainNode: null! as GainNode,
analyzer: null! as AnalyserNode,

bands: [] as Band[],

Expand Down
7 changes: 5 additions & 2 deletions resources/assets/js/stores/commonStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { playlistFolderStore, playlistStore, preferenceStore, queueStore, settin
const initialState = {
allows_download: false,
cdn_url: '',
current_user: undefined as unknown as User,
current_user: null! as User,
current_version: '',
koel_plus: {
active: false,
Expand Down Expand Up @@ -47,7 +47,10 @@ export const commonStore = {
Object.assign(this.state, await http.get<CommonStoreState>('data'))

// Always disable YouTube integration on mobile.
this.state.uses_you_tube = this.state.uses_you_tube && !isMobile.phone
this.state.uses_you_tube = this.state.uses_you_tube && !isMobile.any

// Only enable transcoding on mobile
this.state.supports_transcoding = this.state.supports_transcoding && isMobile.any

userStore.init(this.state.current_user)
preferenceStore.init(this.state.current_user.preferences)
Expand Down
2 changes: 1 addition & 1 deletion resources/assets/js/stores/userStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const userStore = {

state: reactive({
users: [] as User[],
current: null as unknown as User
current: null! as User
}),

syncWithVault (users: MaybeArray<User>) {
Expand Down

0 comments on commit 0f3e945

Please sign in to comment.