]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - src/App.vue
Toggle dark mode when `prefers-color-scheme` changes
[github/bastienwirtz/homer.git] / src / App.vue
index 5ab5c0d81e6b5da5fbc590cececf25ba8db3e5ba..25e943f7d80082515c92a79dbee5f81ea14797e3 100644 (file)
 </template>
 
 <script>
-import jsyaml from "js-yaml";
+import { parse } from "yaml";
 import merge from "lodash.merge";
 
 import Navbar from "./components/Navbar.vue";
@@ -200,14 +200,16 @@ export default {
       }
     },
     buildDashboard: async function () {
-      const defaults = jsyaml.load(defaultConfig);
+      const defaults = parse(defaultConfig);
       let config;
       try {
         config = await this.getConfig();
         this.currentPage = window.location.hash.substring(1) || "default";
 
         if (this.currentPage !== "default") {
-          let pageConfig = await this.getConfig(`assets/${this.currentPage}.yml`);
+          let pageConfig = await this.getConfig(
+            `assets/${this.currentPage}.yml`
+          );
           config = Object.assign(config, pageConfig);
         }
       } catch (error) {
@@ -243,7 +245,7 @@ export default {
         return response
           .text()
           .then((body) => {
-            return jsyaml.load(body);
+            return parse(body);
           })
           .then(function (config) {
             if (config.externalConfig) {