Skip to content

Commit

Permalink
Auto-linker: poor man's edit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pferreir authored and ThiefMaster committed Nov 1, 2023
1 parent ec56cf0 commit 73813de
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ export default function AutoLinkerConfig({rules, onChange}) {
const onRemove = async n => {
try {
const newRules = [...rules];
newRules.splice(n, 1);
const [oldRule] = newRules.splice(n, 1);
await indicoAxios.post(autoLinkerConfigUrl(), {rules: newRules});
onChange(newRules);
setNewRule({regex: '', url: ''});
setNewRule(oldRule);
} catch (e) {
handleAxiosError(e);
}
Expand Down

0 comments on commit 73813de

Please sign in to comment.