VUEX, what to do when $store.state is null

When users are not logged into my website, the state of user is set to null. However, this throws up a lot of issues on some pages where i look to see if this.$store.user For example, if I were to have a simple check such as and the user is not logged in (thus, setting the state of user to null by default) I get this error; How should I correctly handle this sort of issues so that my console does not get flooded with typescript errors? My initial idea was to first check if user.loggedIn == true and wrap

uploading and downloading storage images in firebase with VueJs

im building this simple application using Vue/vuex and firebase where i want to facilitate users upload images and once the app gets updated those images get reached from firebase storage , modifying the current database with the new uploaded image Here is my code: the images get push to the firebase storaged but once i try to modify the database adding this new element (image) using downloadUrls, doesnt work. Any advice please?….thanks in advance!!! Answer You need to use the getDownloadURL() method from the JavaScript SDK, which is asynchronous and returns a Promise that resolves with the download URL. So,

How to save data in Vue instance

The question is quite simple, All I want is to get the data after the AJAX post saved in Vue instace’s data. Here is my code: And after I trigger the getUserAcc(id) method,I try to verify the VMList.user value in browser console,and I get only the id.Seems like after the function is over the data is reset.How could I store the data from the AJAX post request in the user object from data:{…} ? Thank you for help!!! Answer The problem is that this inside your ajax return function doesn’t refer to the vue instance anymore. The solution is to