I'm trying to implement revert function but have an issue
revert(uniqueFileId, load, error) {
const desertRef = this.storage.ref().child(uniqueFileId);
desertRef.delete().then(function () {
const index = self.files.indexOf(uniqueFileId);
if (index > -1) {
self.files.splice(index, 1);
}
load();
}).catch(function (e) {
switch (e.code) {
case 'storage/canceled':
break;
default:
error(e.message)
}
});
},
full source https://gist.github.com/boskiv/dd299cebcec4ca9ef8b8d792c7b4a420
In this case uniqueFileId
in revert function contain full URL from storage.(https://firebasestorage.googleapis.com/v0/b/koko-date-dev.appspot.com/o/gifts%2FhfvhV6Iou15pBj1mhA8b)
Is there option to get just filename in that case without complex parsing and string split