mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-06 21:22:36 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
cdfb015638 | |||
435fe04ab3 | |||
4e73882bf1 | |||
f2d9b29baa | |||
eaf9113c92 | |||
194571e132 |
4
.github/workflows/extension-test.yml
vendored
4
.github/workflows/extension-test.yml
vendored
@ -25,8 +25,6 @@ jobs:
|
||||
cache-dependency-path: "frontend/extension/pnpm-lock.yaml"
|
||||
- run: pnpm install
|
||||
working-directory: frontend/extension
|
||||
- run: pnpm type-gen
|
||||
working-directory: frontend/extension
|
||||
- name: Run eslint check
|
||||
run: pnpm lint
|
||||
working-directory: frontend/extension
|
||||
@ -45,8 +43,6 @@ jobs:
|
||||
cache-dependency-path: "frontend/extension/pnpm-lock.yaml"
|
||||
- run: pnpm install
|
||||
working-directory: frontend/extension
|
||||
- run: pnpm type-gen
|
||||
working-directory: frontend/extension
|
||||
- name: Run extension build
|
||||
run: pnpm build
|
||||
working-directory: frontend/extension
|
||||
|
4
.github/workflows/frontend-test.yml
vendored
4
.github/workflows/frontend-test.yml
vendored
@ -25,8 +25,6 @@ jobs:
|
||||
cache-dependency-path: "frontend/web/pnpm-lock.yaml"
|
||||
- run: pnpm install
|
||||
working-directory: frontend/web
|
||||
- run: pnpm type-gen
|
||||
working-directory: frontend/web
|
||||
- name: Run eslint check
|
||||
run: pnpm lint
|
||||
working-directory: frontend/web
|
||||
@ -45,8 +43,6 @@ jobs:
|
||||
cache-dependency-path: "frontend/web/pnpm-lock.yaml"
|
||||
- run: pnpm install
|
||||
working-directory: frontend/web
|
||||
- run: pnpm type-gen
|
||||
working-directory: frontend/web
|
||||
- name: Run frontend build
|
||||
run: pnpm build
|
||||
working-directory: frontend/web
|
||||
|
@ -6,7 +6,7 @@ COPY . .
|
||||
|
||||
WORKDIR /frontend-build/frontend/web
|
||||
|
||||
RUN corepack enable && pnpm i --frozen-lockfile && pnpm type-gen
|
||||
RUN corepack enable && pnpm i --frozen-lockfile
|
||||
|
||||
RUN pnpm build
|
||||
|
||||
|
@ -10,6 +10,7 @@ var allowedMethodsWhenUnauthorized = map[string]bool{
|
||||
"/slash.api.v2.AuthService/SignOut": true,
|
||||
"/memos.api.v2.AuthService/GetAuthStatus": true,
|
||||
"/slash.api.v2.ShortcutService/GetShortcutByName": true,
|
||||
"/slash.api.v2.ShortcutService/GetShortcut": true,
|
||||
"/slash.api.v2.CollectionService/GetCollectionByName": true,
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
"package": "plasmo package",
|
||||
"lint": "eslint --ext .js,.ts,.tsx, src",
|
||||
"lint-fix": "eslint --ext .js,.ts,.tsx, src --fix",
|
||||
"type-gen": "cd ../../proto && buf generate"
|
||||
"postinstall": "cd ../../proto && buf generate"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.11.3",
|
||||
|
@ -6,7 +6,7 @@
|
||||
"serve": "vite preview",
|
||||
"lint": "eslint --ext .js,.ts,.tsx, src",
|
||||
"lint-fix": "eslint --ext .js,.ts,.tsx, src --fix",
|
||||
"type-gen": "cd ../../proto && buf generate"
|
||||
"postinstall": "cd ../../proto && buf generate"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.11.3",
|
||||
|
@ -17,6 +17,7 @@ const ShortcutSpace = () => {
|
||||
const currentUser = userStore.getCurrentUser();
|
||||
const shortcutStore = useShortcutStore();
|
||||
const [shortcut, setShortcut] = useState<Shortcut>();
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [showCreateShortcutDrawer, setShowCreateShortcutDrawer] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
@ -28,15 +29,21 @@ const ShortcutSpace = () => {
|
||||
console.error(error);
|
||||
toast.error(error.details);
|
||||
}
|
||||
setLoading(false);
|
||||
})();
|
||||
}, [shortcutName]);
|
||||
|
||||
if (loading) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!shortcut) {
|
||||
if (!currentUser) {
|
||||
navigateTo("/404");
|
||||
return null;
|
||||
}
|
||||
console.log("currentUser", currentUser);
|
||||
|
||||
// If shortcut is not found, prompt user to create it.
|
||||
return (
|
||||
<>
|
||||
<div className="w-full h-[100svh] flex flex-col justify-center items-center p-4">
|
||||
@ -59,12 +66,14 @@ const ShortcutSpace = () => {
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
// If shortcut is a URL, redirect to it directly.
|
||||
if (isURL(shortcut.link)) {
|
||||
window.document.title = "Redirecting...";
|
||||
window.location.href = shortcut.link;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Otherwise, render the shortcut link as plain text.
|
||||
return <div>{shortcut.link}</div>;
|
||||
};
|
||||
|
@ -9,10 +9,10 @@ import (
|
||||
|
||||
// Version is the service current released version.
|
||||
// Semantic versioning: https://semver.org/
|
||||
var Version = "0.5.2"
|
||||
var Version = "0.5.3"
|
||||
|
||||
// DevVersion is the service current development version.
|
||||
var DevVersion = "0.5.2"
|
||||
var DevVersion = "0.5.3"
|
||||
|
||||
func GetCurrentVersion(mode string) string {
|
||||
if mode == "dev" || mode == "demo" {
|
||||
|
@ -2,7 +2,6 @@ package sqlite
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
@ -178,16 +177,6 @@ func (d *DB) DeleteMemo(ctx context.Context, delete *store.DeleteMemo) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func vacuumMemo(ctx context.Context, tx *sql.Tx) error {
|
||||
stmt := `DELETE FROM memo WHERE creator_id NOT IN (SELECT id FROM user)`
|
||||
_, err := tx.ExecContext(ctx, stmt)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func placeholders(n int) string {
|
||||
return strings.Repeat("?,", n-1) + "?"
|
||||
}
|
||||
|
@ -166,9 +166,6 @@ func (d *DB) DeleteUser(ctx context.Context, delete *store.DeleteUser) error {
|
||||
if err := vacuumShortcut(ctx, tx); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := vacuumMemo(ctx, tx); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := vacuumCollection(ctx, tx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user