mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
fix: share url (#1948)
This commit is contained in:
@@ -1,21 +1,17 @@
|
|||||||
# AFFiNE Electron App
|
# AFFiNE Electron App
|
||||||
|
|
||||||
# ⚠️ NOTE ⚠️
|
|
||||||
|
|
||||||
Due to PNPM related issues, this project is currently using **yarn 3**.
|
|
||||||
See https://github.com/electron/forge/issues/2633
|
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
```
|
To run AFFiNE Desktop Client Application locally, run the following commands:
|
||||||
# in project root, start web app at :8080
|
|
||||||
|
```sh
|
||||||
|
# in repo root
|
||||||
|
yarn install
|
||||||
yarn dev
|
yarn dev
|
||||||
|
|
||||||
# build octobase-node
|
# in apps/electron
|
||||||
yarn workspace @affine/octobase-node build
|
yarn generate-assets
|
||||||
|
yarn dev # or yarn prod for production build
|
||||||
# in /apps/electron, start electron app
|
|
||||||
yarn dev
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { getEnvironment } from '@affine/env';
|
import { prefixUrl } from '@affine/env';
|
||||||
import { Trans, useTranslation } from '@affine/i18n';
|
import { Trans, useTranslation } from '@affine/i18n';
|
||||||
import type { LocalWorkspace } from '@affine/workspace/type';
|
import type { LocalWorkspace } from '@affine/workspace/type';
|
||||||
import { WorkspaceFlavour } from '@affine/workspace/type';
|
import { WorkspaceFlavour } from '@affine/workspace/type';
|
||||||
@@ -46,12 +46,7 @@ export const AffineSharePage: FC<ShareMenuProps> = props => {
|
|||||||
const [showDisable, setShowDisable] = useState(false);
|
const [showDisable, setShowDisable] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const sharingUrl = useMemo(() => {
|
const sharingUrl = useMemo(() => {
|
||||||
const env = getEnvironment();
|
return `${prefixUrl}public-workspace/${props.workspace.id}/${props.currentPage.id}`;
|
||||||
if (env.isBrowser) {
|
|
||||||
return `${env.origin}/public-workspace/${props.workspace.id}/${props.currentPage.id}`;
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
}, [props.workspace.id, props.currentPage.id]);
|
}, [props.workspace.id, props.currentPage.id]);
|
||||||
const onClickCreateLink = useCallback(() => {
|
const onClickCreateLink = useCallback(() => {
|
||||||
setIsPublic(true);
|
setIsPublic(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user