add simple reload action
This commit is contained in:
parent
09ebf454d4
commit
b6fc0c08ff
@ -52,6 +52,15 @@ public class InstanceManager {
|
||||
return this.bus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads the plugin instance. Unsaved cached data will be deleted.
|
||||
* Fetches data from persistence layer and notifies all endpoints via {@link DataBus}.
|
||||
*/
|
||||
public void reload() {
|
||||
store.loadFromPersistenceLayer((success) ->
|
||||
bus.propagate().onUpdateData(store.getData()));
|
||||
}
|
||||
|
||||
public void processUpdate(TranslationUpdate update) {
|
||||
if(update.isDeletion() || update.isKeyChange()) { // Remove origin translation
|
||||
this.store.getData().setTranslation(update.getOrigin().getKey(), null);
|
||||
|
Loading…
x
Reference in New Issue
Block a user