|
|
|
@ -69,6 +69,18 @@ const bin_name_commit_handler = function(state, dispatch){
|
|
|
|
|
api.post('/bin-rename', {bin_id:state.bin.id, name:state.temp_bin_name});
|
|
|
|
|
dispatch('commit-bin-name');
|
|
|
|
|
};
|
|
|
|
|
const choose_bin_handler = function(state, dispatch, bin_id){
|
|
|
|
|
window.history.pushState(null,'','#'+bin_id);
|
|
|
|
|
dispatch('bin-requested', bin_id);
|
|
|
|
|
api.post('/load-bin', {bin_id})
|
|
|
|
|
.then(res=>{
|
|
|
|
|
dispatch('bin-loaded', res.bin);
|
|
|
|
|
});
|
|
|
|
|
api.post('/load-notes', {bin_id})
|
|
|
|
|
.then(res=>{
|
|
|
|
|
dispatch('notes-loaded', res.notes);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export {new_note_handler,
|
|
|
|
|
search_term_change_handler,
|
|
|
|
@ -81,5 +93,6 @@ export {new_note_handler,
|
|
|
|
|
logout_request_handler,
|
|
|
|
|
bin_name_editing_toggle_button_handler,
|
|
|
|
|
bin_name_change_handler,
|
|
|
|
|
bin_name_commit_handler
|
|
|
|
|
bin_name_commit_handler,
|
|
|
|
|
choose_bin_handler
|
|
|
|
|
};
|