Skip to content

Commit 1c30245

Browse files
committed
[CODEBREW] Added video 010 progress
1 parent 12ff7a5 commit 1c30245

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/store/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ export default new Vuex.Store({
4141
},
4242
async uploadProfilePicture({ commit }, payload) {
4343
var storageRef = fb.storage.ref();
44-
var pictureRef = storageRef.child("profilePicture.png");
44+
var pictureRef = storageRef.child(
45+
"users/" + payload.uid + "/profilePicture.png"
46+
);
4547
return pictureRef.put(payload.image).then((snapshot) => {
4648
return snapshot.ref.getDownloadURL().then((res) => {
4749
console.log(res);
@@ -50,8 +52,9 @@ export default new Vuex.Store({
5052
});
5153
},
5254
async fetchProfilePicture({ commit }) {
55+
var uid = fb.auth.currentUser.uid;
5356
var storageRef = fb.storage.ref();
54-
var pictureRef = storageRef.child("profilePicture.png");
57+
var pictureRef = storageRef.child("users/" + uid + "/profilePicture.png");
5558
return pictureRef.getDownloadURL().then((res) => {
5659
console.log(res);
5760
commit("setImageURL", res);

0 commit comments

Comments
 (0)