mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	Move frontend config loading to App.vue.
This commit is contained in:
		
							parent
							
								
									8901a97fcb
								
							
						
					
					
						commit
						1265044854
					
				
					 2 changed files with 30 additions and 10 deletions
				
			
		
							
								
								
									
										11
									
								
								src/App.vue
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								src/App.vue
									
										
									
									
									
								
							| 
						 | 
					@ -9,7 +9,7 @@
 | 
				
			||||||
            </router-view>
 | 
					            </router-view>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <FooterComponent />
 | 
					        <FooterComponent :config="config" />
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,6 +27,7 @@ export default {
 | 
				
			||||||
    data() {
 | 
					    data() {
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            theme: "dark",
 | 
					            theme: "dark",
 | 
				
			||||||
 | 
					            config: null,
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    mounted() {
 | 
					    mounted() {
 | 
				
			||||||
| 
						 | 
					@ -35,6 +36,14 @@ export default {
 | 
				
			||||||
            this.setTheme();
 | 
					            this.setTheme();
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        this.fetchJson(this.authApiUrl() + "/config")
 | 
				
			||||||
 | 
					            .then(config => {
 | 
				
			||||||
 | 
					                this.config = config;
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            .then(() => {
 | 
				
			||||||
 | 
					                this.onConfigLoaded();
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ("indexedDB" in window) {
 | 
					        if ("indexedDB" in window) {
 | 
				
			||||||
            const request = indexedDB.open("piped-db", 5);
 | 
					            const request = indexedDB.open("piped-db", 5);
 | 
				
			||||||
            request.onupgradeneeded = ev => {
 | 
					            request.onupgradeneeded = ev => {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,6 +29,15 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
 | 
					<<<<<<< Updated upstream
 | 
				
			||||||
 | 
					=======
 | 
				
			||||||
 | 
					    props: {
 | 
				
			||||||
 | 
					        config: {
 | 
				
			||||||
 | 
					            type: Object,
 | 
				
			||||||
 | 
					            required: true,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					>>>>>>> Stashed changes
 | 
				
			||||||
    data() {
 | 
					    data() {
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            donationHref: null,
 | 
					            donationHref: null,
 | 
				
			||||||
| 
						 | 
					@ -36,16 +45,18 @@ export default {
 | 
				
			||||||
            privacyPolicyHref: null,
 | 
					            privacyPolicyHref: null,
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    mounted() {
 | 
					    props: {
 | 
				
			||||||
        this.fetchConfig();
 | 
					        config: {
 | 
				
			||||||
 | 
					            type: Object,
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    methods: {
 | 
					    watch: {
 | 
				
			||||||
        async fetchConfig() {
 | 
					        config: {
 | 
				
			||||||
            this.fetchJson(this.apiUrl() + "/config").then(config => {
 | 
					            handler() {
 | 
				
			||||||
                this.donationHref = config?.donationUrl;
 | 
					                this.donationHref = this.config?.donationUrl;
 | 
				
			||||||
                this.statusPageHref = config?.statusPageUrl;
 | 
					                this.statusPageHref = this.config?.statusPageUrl;
 | 
				
			||||||
                this.privacyPolicyHref = config?.privacyPolicyUrl;
 | 
					                this.privacyPolicyHref = this.config?.privacyPolicyUrl;
 | 
				
			||||||
            });
 | 
					            },
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue