Adjust fonts

This commit is contained in:
root
2021-10-22 08:53:03 +05:30
parent b90ce768d1
commit e08df6ff8f
6 changed files with 29 additions and 7 deletions
+1
View File
@@ -134,6 +134,7 @@ export default {
},
created () {
this.$store.dispatch('prefs/loadState')
this.$store.dispatch('auth/initializeAuth')
}
}
</script>
-1
View File
@@ -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
View File
@@ -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()
+1 -1
View File
@@ -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',
+15 -1
View File
@@ -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,
+7 -1
View File
@@ -12,4 +12,10 @@
}
}
@include addFonts('Hind Siliguri');
.latin {
@include addFonts('Helvetica Neue');
}
.bengali {
@include addFonts('Hind Silliguri')
}