-
Notifications
You must be signed in to change notification settings - Fork 187
Conversation
…ations so we don't forget where they go.
}); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget the super.render().
At some point, I think I'll try and write a test that would check all views and ensure that if they are using getCachedEl, that they are calling super.render(). It's really easy to forget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might not be a bad idea to pass isPurging: this.purge && this.purge.state() === 'pending'
into the template and then use that in the template to decide whether the processing
class should be applied to the button.
Otherwise, if you re-render during a purge (e.g. user clicks Save), then the spinner state is lost and the user might just kick off another purge.
js/languages/en-US.json
Outdated
"purgeBtn": "Purge Files", | ||
"purgeToolTip": "OpenBazaar shares content you have viewed with other users. If you have viewed text or images you don't want to share this button will delete them. This will not affect any files that belong to you.", | ||
"purgeError": "There was an error, your cached files may not have been deleted.", | ||
"purgeComplete": "Your cached files have been deleted." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to check with @cpacia to know if 'ob/purgecache' returns after the purge is complete or if it just kicks off a purge, returns immediately, and the purge finished at some time. That's how the publish api works. If the purge API works the same way, I think we'd want to tweak the messaging since Your cached files have been deleted.
wouldn't be completely accurate.
- added a purging state so the purging button maintains state on a re-render. - added a complete state so the complete message is maintained on a re-render. - added a saving state so the saving button is maintained on a re-render. - adjusted the text.
@rmisio this is updated. I also updated the save button with a saving state, so it will maintain it's state the same way the purging button will, and updated the save button to use getCachedEl. Chris confirmed the purge api returns after it has completed. It usually only takes 40-50ms, but in theory could be longer. |
js/views/modals/Settings/Advanced.js
Outdated
return this._$btnSave || | ||
(this._$btnSave = this.$('.js-save')); | ||
} | ||
|
||
render() { | ||
loadTemplate('modals/settings/advanced.html', (t) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget the super.render() if using getCachedEl.
This adds a purge button to settings/advanced that will remove all shared files from your server. This addresses concerns of users in areas that prohibit distribution of some content, if those users inadvertently view prohibited content they can clear their cache so it's not shared with other users over IPFS.