mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-20 21:46:20 +00:00
Deleted SettingsService, as the task is not transparently handled by a redux middleware
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
const SETTINGS_STORAGE_KEY = 'settings';
|
||||
|
||||
export default class SettingsService {
|
||||
constructor(storage) {
|
||||
this.storage = storage;
|
||||
}
|
||||
|
||||
loadSettings = () => this.storage.get(SETTINGS_STORAGE_KEY) || {};
|
||||
|
||||
updateSettings = (settingsToUpdate) => this.storage.set(SETTINGS_STORAGE_KEY, {
|
||||
...this.loadSettings(),
|
||||
...settingsToUpdate,
|
||||
})
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import RealTimeUpdates from '../RealTimeUpdates';
|
||||
import Settings from '../Settings';
|
||||
import { setRealTimeUpdates } from '../reducers/settings';
|
||||
import SettingsService from './SettingsService';
|
||||
|
||||
const provideServices = (bottle, connect) => {
|
||||
// Components
|
||||
@@ -10,9 +9,6 @@ const provideServices = (bottle, connect) => {
|
||||
bottle.serviceFactory('RealTimeUpdates', () => RealTimeUpdates);
|
||||
bottle.decorator('RealTimeUpdates', connect([ 'settings' ], [ 'setRealTimeUpdates' ]));
|
||||
|
||||
// Services
|
||||
bottle.service('SettingsService', SettingsService, 'Storage');
|
||||
|
||||
// Actions
|
||||
bottle.serviceFactory('setRealTimeUpdates', () => setRealTimeUpdates);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user