Skip to content

Commit

Permalink
revert defualt tab to html
Browse files Browse the repository at this point in the history
  • Loading branch information
bangnokia committed Jun 15, 2022
1 parent 84cf889 commit 4fda68b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/EmailBodyTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BrokenLinksChecker from "./BrokenLinksChecker";

export default function EmailBodyTabs({ email }: { email: Email }) {
const tabs = ["html", "html source", "text", "raw", 'links checker'];
const [activeTab, setActiveTab] = useState("links checker");
const [activeTab, setActiveTab] = useState("html");

return (
<>
Expand Down
8 changes: 1 addition & 7 deletions src/store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ const useStore = create<AppState>((set) => ({
currentEmailId: state.currentEmailId === email.id ? undefined : state.currentEmailId,
})),
setEmailLinks: (email: Email, links: EmailLink[]) => set((state) => {
const index = state.emails.findIndex((e) => e.id === email.id);
if (index === -1) {
return state;
}
// replace the email in the state
const newEmails = [...state.emails];
newEmails[index] = { ...email, links };
const newEmails = state.emails.map(e => e.id === email.id ? { ...email, links } : e);
return { emails: newEmails };
})
}));
Expand Down

0 comments on commit 4fda68b

Please sign in to comment.