diff --git a/src/mixins.ts b/src/mixins.ts
index 36596be..0d6e2a5 100644
--- a/src/mixins.ts
+++ b/src/mixins.ts
@@ -43,22 +43,22 @@ export async function getEndpoint(endpoint: string) {
export function getDefaultSettings() {
return {
- "audioOnly": {
- "name": "Audio Only",
- "selected": false,
- "type": "checkbox"
+ audioOnly: {
+ name: 'Audio Only',
+ selected: false,
+ type: 'checkbox'
},
- "defaultQuality": {
- "name": "Default Quality",
- "options": ["160p", "360p", "480p", "720p", "1080p"],
- "selected": "480p",
- "type": "option"
- },
- "chatVisible": {
- "name": "Hide Chat",
- "selected": false,
- "type": "checkbox"
+ defaultQuality: {
+ name: 'Default Quality',
+ options: ['160p', '360p', '480p', '720p', '1080p'],
+ selected: '480p',
+ type: 'option'
},
+ chatVisible: {
+ name: 'Hide Chat',
+ selected: false,
+ type: 'checkbox'
+ }
}
}
@@ -75,7 +75,7 @@ export function getSetting(key: string): boolean | string {
}
export function chatVisible() {
- const p = getSetting("chatVisible")
+ const p = getSetting('chatVisible')
// Flip becuase on the setting page it's
// displayed as "Hide Chat", but the value
// is chatVisible
diff --git a/src/types/Chat.ts b/src/types/Chat.ts
index b167226..34f23dd 100644
--- a/src/types/Chat.ts
+++ b/src/types/Chat.ts
@@ -18,13 +18,13 @@ export interface Metadata {
}
export interface StreamMessageBadge {
- version: string
- setId: string
+ version: string
+ setId: string
}
export interface StreamMessage {
- message: string
- username: string
- color: string
- badges: StreamMessageBadge[]
+ message: string
+ username: string
+ color: string
+ badges: StreamMessageBadge[]
}
diff --git a/src/types/VOD.ts b/src/types/VOD.ts
index 14017dc..85d66fa 100644
--- a/src/types/VOD.ts
+++ b/src/types/VOD.ts
@@ -15,7 +15,7 @@ export interface MinifiedStreamer {
}
export interface Video {
- type: "vod" | "clip"
+ type: 'vod' | 'clip'
preview: string
game: MinifiedCategory
duration: number
diff --git a/src/views/CategoryView.vue b/src/views/CategoryView.vue
index 0d47a42..3530b7c 100644
--- a/src/views/CategoryView.vue
+++ b/src/views/CategoryView.vue
@@ -35,34 +35,34 @@ export default {
},
methods: {
async getMoreStreams() {
- let bottomOfWindow =
- document.documentElement.scrollTop + window.innerHeight ===
- document.documentElement.offsetHeight
- const streams = this.data!.streams
+ let bottomOfWindow =
+ document.documentElement.scrollTop + window.innerHeight ===
+ document.documentElement.offsetHeight
+ const streams = this.data!.streams
- if (bottomOfWindow && streams) {
- // get cursor of the last stream rendered
- const cursor = streams[streams.length - 1].cursor
- if (!cursor) return
+ if (bottomOfWindow && streams) {
+ // get cursor of the last stream rendered
+ const cursor = streams[streams.length - 1].cursor
+ if (!cursor) return
- // get rest of streams from api
- const resData: CategoryData = await getEndpoint(
- `api/discover/${this.$route.params.game}?cursor=${cursor}`
- ).catch((err) => {
- throw err
- })
+ // get rest of streams from api
+ const resData: CategoryData = await getEndpoint(
+ `api/discover/${this.$route.params.game}?cursor=${cursor}`
+ ).catch((err) => {
+ throw err
+ })
- let lastStreamCursor = this.data!.streams[this.data!.streams.length-1].cursor
- let newLastStreamCursor = resData.streams[resData.streams.length-1].cursor
- if (lastStreamCursor === newLastStreamCursor) {
- // Add "no more streams!" screen later
- console.log("no more streams!")
- } else {
- for (let stream of resData.streams) {
- this.data!.streams.push(stream)
- }
+ let lastStreamCursor = this.data!.streams[this.data!.streams.length - 1].cursor
+ let newLastStreamCursor = resData.streams[resData.streams.length - 1].cursor
+ if (lastStreamCursor === newLastStreamCursor) {
+ // Add "no more streams!" screen later
+ console.log('no more streams!')
+ } else {
+ for (let stream of resData.streams) {
+ this.data!.streams.push(stream)
}
}
+ }
},
abbreviate
},
diff --git a/src/views/HomepageView.vue b/src/views/HomepageView.vue
index 0de85b0..ecd0dc0 100644
--- a/src/views/HomepageView.vue
+++ b/src/views/HomepageView.vue
@@ -25,7 +25,10 @@ export default {
methods: {
filterSearches(toFilter: string) {
const categories = this.$refs.categoryItem
- const wantedTags: string[] = toFilter.toLowerCase().split(',').filter((v) => v.toLowerCase())
+ const wantedTags: string[] = toFilter
+ .toLowerCase()
+ .split(',')
+ .filter((v) => v.toLowerCase())
for (let category of categories as any) {
let tagElements = category.getElementsByTagName('span')
@@ -49,18 +52,18 @@ export default {
}
},
async getNextCategory() {
- let bottomOfWindow =
- document.documentElement.scrollTop + window.innerHeight ===
- document.documentElement.offsetHeight
- if (bottomOfWindow && this.data) {
- const cursor = this.data[this.data.length - 1].cursor
- if (!cursor) return
- const res = await getEndpoint('api/discover?cursor=' + cursor)
+ let bottomOfWindow =
+ document.documentElement.scrollTop + window.innerHeight ===
+ document.documentElement.offsetHeight
+ if (bottomOfWindow && this.data) {
+ const cursor = this.data[this.data.length - 1].cursor
+ if (!cursor) return
+ const res = await getEndpoint('api/discover?cursor=' + cursor)
- for (let category of res) {
- this.data.push(category)
- }
+ for (let category of res) {
+ this.data.push(category)
}
+ }
}
},
async mounted() {
@@ -142,6 +145,5 @@ export default {
-
diff --git a/src/views/SettingsView.vue b/src/views/SettingsView.vue
index 64d6eb2..8639f79 100644
--- a/src/views/SettingsView.vue
+++ b/src/views/SettingsView.vue
@@ -2,25 +2,25 @@
import { getDefaultSettings } from '@/mixins'
export default {
- setup() {
- let settings
+ setup() {
+ let settings
- let storedSettings = localStorage.getItem("settings")
- if (storedSettings === null) {
- settings = getDefaultSettings()
- } else {
- settings = JSON.parse(storedSettings)
- }
+ let storedSettings = localStorage.getItem('settings')
+ if (storedSettings === null) {
+ settings = getDefaultSettings()
+ } else {
+ settings = JSON.parse(storedSettings)
+ }
- return {
- settings
- }
- },
- methods: {
- save() {
- const settings = JSON.stringify(this.settings)
- localStorage.setItem('settings', settings)
- },
+ return {
+ settings
+ }
+ },
+ methods: {
+ save() {
+ const settings = JSON.stringify(this.settings)
+ localStorage.setItem('settings', settings)
+ }
// download() {
// var hiddenElement = document.createElement('a');
@@ -40,37 +40,42 @@ export default {
// this.settings = file
// this.save()
// },
- }
- }
+ }
+}
-
-
Settings
-
-
- -
-
-
-
-
+
+
Settings
+
+
+
+
+
+
+
+
-
-
-
-
-
\ No newline at end of file
+
+
+
diff --git a/src/views/UserView.vue b/src/views/UserView.vue
index d00e645..3725e25 100644
--- a/src/views/UserView.vue
+++ b/src/views/UserView.vue
@@ -168,6 +168,11 @@ export default {