-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Community] Changing logo doesn't get propagated #16688
Comments
Turns out adding the role is not enough. I'm very confused why it doesn't want to update. I checked the url from the localhost and it's indeed the new image. I've been banging my head on this for a while and I can't understand. The model is passed correctly as far as I can see, so the I'll give it a rest and come back to it. In the meantime, I found and fixed this: status-im/status-go#6026 |
Is the URL still the same after the update, or a different one? Because if the former is true, the QML Image simply won't reload |
yes. It's something like Is there a way to force the QML to reload the image? |
Yeah, sth like: image.source = ""
image.source = newUrl oh, and you probably have to set |
This worked, but the code is very ugly. I created a commit here 85dd85d, but I think I'll try to see if I can fix it on the status-go side by appending some sort of index at the end of the URL when it gets updated. It would be much cleaner |
Yeah this is indeed ugly 😄 BTW I just found out that we have this function in Utils.qml: function addTimestampToURL(url) {
return globalUtilsInst.addTimestampToURL(url)
} which calls: import times
proc addTimestampToURL*(url: string): string =
if url.len == 0:
return ""
let timestamp = epochTime()
if '?' in url:
return url & "×tamp=" & $timestamp
else:
return url & "?timestamp=" & $timestamp and we wrap some images with it already in QML code (like profile icon). The NIM code above is kinda naive but we could actually call sth like that already in the models serving images; this way the URL won't be the same, and thus no need to disable caching, or forcing an empty URL to reload the Image on the QML side |
Ah that's very helpful! That explains why when I did the I do have a branch with status-go work to fix it (it adds a version to the URL). I just need to fix the tests. It should be simpler and cleaner that way |
Perhaps related (or the same issue):
If I change the community logo, it's persisted but will update only after app restart (I suspect the banner too but this one is hard to check as it's not visible anywhere else in the app)
Originally posted by @caybro in #16672
The text was updated successfully, but these errors were encountered: