Skip to content

Commit

Permalink
refactor(wording): add better wording
Browse files Browse the repository at this point in the history
  • Loading branch information
ph1p committed May 1, 2020
1 parent 7769dda commit 6a1c31e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ main().then(({ roomName, secret, history, instanceId }) => {
case 'get-selection':
sendSelection();
break;
case 'remove-all-messages':
case 'clear-chat-history':
figma.root.setPluginData('history', '[]');

postMessage('history', JSON.parse('[]'));
Expand Down
8 changes: 4 additions & 4 deletions src/store/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ class RootStore {
}

@action
removeAllMessages(cb: () => void) {
clearChatHistory(cb: () => void) {
if (
(window as any).confirm('Remove all messages? (This cannot be undone)')
(window as any).confirm('Do you really want to delete the complete chat history? (This cannot be undone)')
) {
sendMainMessage('remove-all-messages');
sendMainMessage('clear-chat-history');
this.messages = [];
cb();
this.addNotification('Messages successfully removed');
this.addNotification('Chat history successfully deleted');
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/views/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ const SettingsView: FunctionComponent<SettingsProps> = (props) => {
<div className="delete-history">
<button
type="submit"
onClick={() => store.removeAllMessages(() => saveSettings(true))}
onClick={() => store.clearChatHistory(() => saveSettings(true))}
className="button button--secondary"
>
Delete history
Clear chat history
</button>
</div>

Expand Down

0 comments on commit 6a1c31e

Please sign in to comment.