os-js / osjs-client

OS.js Client Module
https://manual.os-js.org/
Other
30 stars 30 forks source link

Omitting Home path from client #210

Closed mahsashadi closed 6 months ago

mahsashadi commented 6 months ago

Hello

we are searching for a way to omit osjs and home mountpoints from client, but it leads to error since we don't have any other mountpoint to set as defaultPath.

We have other mounpoint, but its name is known at run time (We only know that it ends with Drive)

 //src/client/index.js

  const foundMount = osjs.configuration.vfs.mountpoints.find((mount) => mount.name === 'osjs');
  if (foundMount) {
    foundMount.enabled = false;
  }

  const foundMount1 = osjs.configuration.vfs.mountpoints.find((mount) => mount.name === 'home');
  if (foundMount1) {
    foundMount1.enabled = false;
  }
//src/client/config.js

vfs: {
  defaultPath: '', 
  }

Screenshot from 2024-01-02 18-11-39

what is the solution? @andersevenrud

andersevenrud commented 6 months ago

Set the default to the application mountpoint, then try setting the configuration on run-time.

// Somewhere in your service
core.configuration.vfs.defaultPath = yourResolvedMountpoint;
maryam4s26 commented 6 months ago

hi thanks a lot As you said, I have made the following settings in the src/client/config.js and it worked correctly.

  vfs: {
    defaultPath: 'apps:/',
  }

Also according to what you said, I was able to dynamically set the default value in the client side provider service.

andersevenrud commented 6 months ago

Great!

Please close the issues you create when a solution has been produced.