mirror of
https://github.com/mmjee/Piped-Material.git
synced 2024-12-06 19:26:36 +01:00
Adjust fonts
This commit is contained in:
@@ -134,6 +134,7 @@ export default {
|
||||
},
|
||||
created () {
|
||||
this.$store.dispatch('prefs/loadState')
|
||||
this.$store.dispatch('auth/initializeAuth')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
|
||||
import '@fontsource/hind-siliguri/latin.css'
|
||||
import '@/styles/main.scss'
|
||||
|
||||
import { i18n } from '@/plugins/i18n'
|
||||
|
||||
+5
-3
@@ -65,10 +65,12 @@ export async function changeLocale (lang) {
|
||||
}
|
||||
|
||||
function initializeLocalLocale () {
|
||||
const lang = window.localStorage.getItem('LOCALE')
|
||||
if (lang != null) {
|
||||
changeLocale(lang).catch(e => console.error(e))
|
||||
let lang = window.localStorage.getItem('LOCALE')
|
||||
if (lang == null) {
|
||||
// Default language
|
||||
lang = 'en'
|
||||
}
|
||||
changeLocale(lang).catch(e => console.error(e))
|
||||
}
|
||||
|
||||
initializeLocalLocale()
|
||||
|
||||
@@ -238,7 +238,7 @@ export default {
|
||||
this.fetchComments().then(data => (this.comments = data))
|
||||
},
|
||||
async fetchSubscribedStatus () {
|
||||
if (!this.channelId) return
|
||||
if (!this.channelId || !this.$store.state['auth/isAuthenticated']) return
|
||||
|
||||
this.$store.dispatch('auth/makeRequest', {
|
||||
path: '/subscribed',
|
||||
|
||||
@@ -5,11 +5,25 @@ const AuthenticationStore = {
|
||||
namespaced: true,
|
||||
|
||||
state: () => ({
|
||||
isAuthenticated: true,
|
||||
isAuthenticated: false,
|
||||
authToken: null
|
||||
}),
|
||||
|
||||
mutations: {
|
||||
replaceAuth (state, data) {
|
||||
state.isAuthenticated = data.isAuthenticated ?? state.isAuthenticated
|
||||
state.authToken = data.authToken ?? state.authToken
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
initializeAuth ({ commit }) {
|
||||
const data = window.localStorage.getItem('AUTH')
|
||||
if (data != null) {
|
||||
commit('replaceAuth', data)
|
||||
}
|
||||
},
|
||||
|
||||
async makeRequest ({
|
||||
commit,
|
||||
state,
|
||||
|
||||
@@ -12,4 +12,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
@include addFonts('Hind Siliguri');
|
||||
.latin {
|
||||
@include addFonts('Helvetica Neue');
|
||||
}
|
||||
|
||||
.bengali {
|
||||
@include addFonts('Hind Silliguri')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user