mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
chore(mobile): set doc readonly in edgeless mode (#9068)
Close [BS-1984](https://linear.app/affine-design/issue/BS-1984/edgeless-禁用编辑后,白板上,image-block-chat-block-可以移动), [BS-1918](https://linear.app/affine-design/issue/BS-1918/edgeless-移动端只读模式下,应当是单指移动,双指缩放), [BS-2035](https://linear.app/affine-design/issue/BS-2035/切换-edgeless-view-变为只读)
This commit is contained in:
@@ -83,6 +83,8 @@ const DetailPageImpl = () => {
|
||||
|
||||
const enableKeyboardToolbar =
|
||||
featureFlagService.flags.enable_mobile_keyboard_toolbar.value;
|
||||
const enableEdgelessEditing =
|
||||
featureFlagService.flags.enable_mobile_edgeless_editing.value;
|
||||
const { setDocReadonly } = useDocMetaHelper();
|
||||
|
||||
// TODO(@eyhn): remove jotai here
|
||||
@@ -111,8 +113,17 @@ const DetailPageImpl = () => {
|
||||
}, [doc, globalContext, mode]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!enableKeyboardToolbar) setDocReadonly(doc.id, true);
|
||||
}, [enableKeyboardToolbar, doc.id, setDocReadonly]);
|
||||
setDocReadonly(
|
||||
doc.id,
|
||||
!enableKeyboardToolbar || (mode === 'edgeless' && !enableEdgelessEditing)
|
||||
);
|
||||
}, [
|
||||
enableKeyboardToolbar,
|
||||
doc.id,
|
||||
setDocReadonly,
|
||||
mode,
|
||||
enableEdgelessEditing,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
globalContext.isTrashDoc.set(!!isInTrash);
|
||||
|
||||
@@ -27,6 +27,9 @@ globalStyle('body:has(#app-tabs) affine-keyboard-toolbar[data-shrink="true"]', {
|
||||
globalStyle('body:has(#app-tabs) affine-keyboard-tool-panel', {
|
||||
paddingBottom: `calc(${globalVars.appTabHeight} + env(safe-area-inset-bottom) + 8px)`,
|
||||
});
|
||||
globalStyle('body:has(#app-tabs) edgeless-toolbar-widget', {
|
||||
bottom: `calc(${globalVars.appTabHeight} + env(safe-area-inset-bottom))`,
|
||||
});
|
||||
globalStyle('html', {
|
||||
height: '100dvh',
|
||||
overflowY: 'auto',
|
||||
|
||||
Reference in New Issue
Block a user