Skip to content

Commit 746595f

Browse files
committed
Fix domain switch
1 parent 2559e17 commit 746595f

File tree

3 files changed

+972
-778
lines changed

3 files changed

+972
-778
lines changed

components/actions.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"use client";
2-
import React, { useState } from "react";
2+
import React, { useEffect, useState } from "react";
33
import { Button } from "@/components/ui/button";
44
import { CheckCircle, Edit, Shuffle } from "lucide-react";
55
import { Input } from "@/components/ui/input";
@@ -16,12 +16,17 @@ function Actions() {
1616
const [mail, setMail] = useState(config.mail);
1717
const [domain, setDomain] = useState(config.domain);
1818

19+
useEffect(() => {
20+
mail !== config.mail && setMail(config.mail);
21+
domain !== config.domain && setDomain(config.domain);
22+
}, [config]);
23+
1924
function onSave() {
20-
if (!mail) {
25+
if (!mail || !domain) {
2126
return;
2227
}
2328
setEdited(false);
24-
if (config.mail != mail) {
29+
if (config.mail != mail || config.domain != domain) {
2530
config.update(mail, domain);
2631
setTimeout(() => emitter.emit(mittKey.REFRESH));
2732
}

package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,32 @@
1414
"@radix-ui/react-slot": "^1.0.2",
1515
"@radix-ui/react-toast": "^1.1.5",
1616
"class-variance-authority": "^0.7.0",
17-
"clsx": "^2.0.0",
18-
"imapflow": "^1.0.147",
19-
"lucide-react": "^0.292.0",
20-
"mailparser": "^3.6.5",
17+
"clsx": "^2.1.0",
18+
"imapflow": "^1.0.152",
19+
"lucide-react": "^0.331.0",
20+
"mailparser": "^3.6.7",
2121
"mitt": "^3.0.1",
22-
"next": "^14.0.3",
22+
"next": "^14.1.0",
2323
"react": "^18.2.0",
2424
"react-dom": "^18.2.0",
25-
"tailwind-merge": "^2.0.0",
26-
"zustand": "^4.4.6"
25+
"tailwind-merge": "^2.2.1",
26+
"zustand": "^4.5.1"
2727
},
2828
"devDependencies": {
29-
"@types/imapflow": "^1.0.16",
29+
"@types/imapflow": "^1.0.18",
3030
"@types/mailparser": "^3.4.4",
31-
"@types/node": "^20.9.1",
32-
"@types/react": "^18.2.37",
33-
"@types/react-dom": "^18.2.15",
34-
"autoprefixer": "^10.4.16",
35-
"eslint": "^8.53.0",
36-
"eslint-config-next": "^14.0.3",
37-
"eslint-config-prettier": "^9.0.0",
38-
"postcss": "^8.4.31",
39-
"prettier": "^3.1.0",
40-
"prettier-plugin-tailwindcss": "^0.5.7",
41-
"tailwindcss": "^3.3.5",
31+
"@types/node": "^20.11.19",
32+
"@types/react": "^18.2.56",
33+
"@types/react-dom": "^18.2.19",
34+
"autoprefixer": "^10.4.17",
35+
"eslint": "^8.56.0",
36+
"eslint-config-next": "^14.1.0",
37+
"eslint-config-prettier": "^9.1.0",
38+
"postcss": "^8.4.35",
39+
"prettier": "^3.2.5",
40+
"prettier-plugin-tailwindcss": "^0.5.11",
41+
"tailwindcss": "^3.4.1",
4242
"tailwindcss-animate": "^1.0.7",
43-
"typescript": "^5.2.2"
43+
"typescript": "^5.3.3"
4444
}
4545
}

0 commit comments

Comments
 (0)