Skip to content

Commit

Permalink
fix download path not saving
Browse files Browse the repository at this point in the history
  • Loading branch information
sneljo1 committed Jan 18, 2019
1 parent e69deb0 commit a1b6086
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/common/store/config/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ export const configReducer: Reducer<ConfigState> = (state = initialState, action
};
case ConfigActionTypes.SET_KEY:

const newConfig = {
...state,
return {
..._.set(state, payload.key, payload.value),
// Otherwise redux connect doesn't correctly re-trigger
updatedAt: Date.now()
};

_.set(newConfig, payload.key, payload.value);

return newConfig;
case PlayerActionTypes.TOGGLE_SHUFFLE:
return {
...state,
Expand Down
2 changes: 2 additions & 0 deletions src/main/features/NotificationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export default class NotificationManager extends Feature {

if (track) {

console.log('send notificat', track);

this.sendToWebContents(EVENTS.APP.SEND_NOTIFICATION, {
title: track.title,
message: `${track.user && track.user.username ? track.user.username : ''}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,17 @@ class InputConfig extends React.PureComponent<Props> {
invalid: false
};

private saveDebounced: (event: React.ChangeEvent<HTMLInputElement>) => void;
private saveDebounced: (value: string) => void;

constructor(props: Props) {
super(props);

this.saveDebounced = debounce(this.handleChange.bind(this), 50);
}

handleChange = (event: React.FormEvent<HTMLInputElement>) => {
handleChange = (value: string) => {
const { configKey, onChange, setConfigKey } = this.props;

const value = event.currentTarget.value;

if (onChange) {
onChange(value, () => {
setConfigKey(configKey, value);
Expand Down Expand Up @@ -66,7 +64,7 @@ class InputConfig extends React.PureComponent<Props> {
'is-invalid': invalid
})}
name={name}
onChange={this.saveDebounced}
onChange={(event: React.ChangeEvent<HTMLInputElement>) => this.saveDebounced(event.target.value)}
placeholder={usePlaceholder ? name : undefined}
defaultValue={value || ''}
/>
Expand Down

0 comments on commit a1b6086

Please sign in to comment.