anyproto / anytype-ts

Official Anytype client for MacOS, Linux, and Windows
https://anytype.io
Other
4.21k stars 255 forks source link

Switch space from online+local to local only after creation #697

Open bf39l opened 5 months ago

bf39l commented 5 months ago

Have you read a contributing guide?

Clear and concise description of the problem

Hi Anytype team first thing first, thank you so much for providing 1GB cloud file storage for online spaces! I am new to Anytype about 3 days and I am not entirly sure I did correct things. But just quickly show you guys how "dumb" I was

So just wondering would that be possible to let user

  1. would that be possible to let user change user data location after creation?
  2. switching space(s) between online+local to local-only after creation?
  3. (optional) would that be possible to make local-only more obvious at on-board stage?

Suggested solution

I am not TS/Electron developer so please bearing with my shallow knowledge on that.

  1. let user change user data location after creation? I read a bit with the source code and added a new "Change" button right next to "Open" button in settings page
    anytype-ts/src/ts/component/popup/page/settings/data.tsx

    ...
    // line 58
    <Button color="blank" className="c28" text={translate(`commonOpen`)} onClick={this.onOpenDataLocation} />
    <Button color="blank" className="c28" text={translate(`commonChange`)} onClick={this.onChangeDataLocation.bind(this)} />
    ...

    I copied over from codes in other places and make the onclick handler like so

    onChangeDataLocation () {
        const onConfirm = () => {
            const cb = (paths: string[]) => {
                Renderer.send('setUserDataPath', paths[0]);
                Renderer.send('exit', "", true);
            }
       Action.openDir({}, cb);
    };
    };

    I tested with online+local spaces, it does change to user data to the new place after restarting and user data also re-sync down. but surely there are lots of things missing eg:

  2. switching space(s) between online+local to local-only after creation? I think this would be the toggle button in space settings page? as far as I understand local-only spaces does not have network id. I though sync everything down for targe space remove the network id from space would work?

  3. (optional) would that be possible to make local-only more obvious at on-board stage? I did not try the mobile/windows/linux versions of anytype, for mac desktop version on-board stage, would that be possible to make drop down list for vault config instead of the Gear button on top right of window?

Alternative

No response

Additional context

No response

ra3orblade commented 5 months ago

Hello, we have decided to no include such logic as it may lead to these consequences that you have described and it can harm your account as you need to restart middleware when you change the folder.