File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ export default new Vuex.Store({
41
41
} ,
42
42
async uploadProfilePicture ( { commit } , payload ) {
43
43
var storageRef = fb . storage . ref ( ) ;
44
- var pictureRef = storageRef . child ( "profilePicture.png" ) ;
44
+ var pictureRef = storageRef . child (
45
+ "users/" + payload . uid + "/profilePicture.png"
46
+ ) ;
45
47
return pictureRef . put ( payload . image ) . then ( ( snapshot ) => {
46
48
return snapshot . ref . getDownloadURL ( ) . then ( ( res ) => {
47
49
console . log ( res ) ;
@@ -50,8 +52,9 @@ export default new Vuex.Store({
50
52
} ) ;
51
53
} ,
52
54
async fetchProfilePicture ( { commit } ) {
55
+ var uid = fb . auth . currentUser . uid ;
53
56
var storageRef = fb . storage . ref ( ) ;
54
- var pictureRef = storageRef . child ( "profilePicture.png" ) ;
57
+ var pictureRef = storageRef . child ( "users/" + uid + "/ profilePicture.png") ;
55
58
return pictureRef . getDownloadURL ( ) . then ( ( res ) => {
56
59
console . log ( res ) ;
57
60
commit ( "setImageURL" , res ) ;
You can’t perform that action at this time.
0 commit comments