Comments (6)
Yeah, this should be fixed. In my testing it doesn't replace any images but just discards the new one and places the original in the tweet instead. I'll fix the issues you found in my PR as well, thank you. I'll contact ccrsxx about the username bug as well.
from twitter-clone.
Yup, but that's by design.
I made it so that when we upload the same image with the same alt, it will return the old image instead of creating the new image. It won't replace the old image with the new image tho.
This is the code:
twitter-clone/src/lib/firebase/utils.ts
Lines 141 to 146 in c6bf6fb
I did it to reduce the bandwidth usage on the storage.
But yeah, that's bad if you upload a different picture with the same alt, it'll return the old one.
I see that the bandwidth usage isn't that much, so I think replacing the alt to id is good idea now.
from twitter-clone.
Yup, that could be the solution. But for now, I''ll be using the randomly generated id.
from twitter-clone.
@Ketchupchh thank you!
from twitter-clone.
@ccrsxx Well, if you want to do this kind of optimisation I think that the better option would be to calculate a hash (e.g. sha256) of a file's content, and use that instead of a filename. That way, the same images with different names, would be stored only once.
from twitter-clone.
Related Issues (20)
- Problem with firebase HOT 9
- Feature: Enabling Local Emulator for Firebase for local development HOT 2
- Cannot read properties of undefined (reading 'createdBy') HOT 9
- Selfhost HOT 4
- Can't upload .png HOT 1
- Localhost When Logging In HOT 7
- Running to xampp page HOT 8
- Unhandled Runtime Error FirebaseError: Failed to get document because the client is offline. HOT 1
- Error: HTTP Error: 403, The caller does not have permission HOT 1
- verification HOT 1
- respond to me on discord - itsmedxmon
- not letting me sign in
- where is the sign in page code & the css? i gotta edit it
- Gifs and Verified user HOT 1
- I love you - I have a request HOT 1
- [Function request] some suggestions HOT 10
- Are users keyed by username? HOT 6
- Trying to implement a permissionless home and user profile page HOT 1
- Why both user/totalTweets and user/stats/stats/tweets.length ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twitter-clone.