!lxLFDpQJHZtqePeIUK:matrix.org

OS.js

137 Members
OS.js Matrix Channel (https://www.os-js.org/)18 Servers

Load older messages


Timestamp Message
23 Mar 2020
14:41:40@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) When you run npm run package:discover it will symlink the package dist into <installation>/dist/apps/<package> hence failed loading if package was not built.
15:35:58@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) @alberkko Did it fix your problem ?
16:04:53@gitter_alberkko:matrix.orgalberkko (Gitter) Not exactly, after i run npm run package:discover the folder /dist/apps/<package> goes empty, and then after i run npm run build the folder dist is created in src/<package> but it's empty, and at /dist/apps/<package> is again empty
16:10:46@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) Just to make sure, you're running npm run build inside the actual package directory, right ?
16:10:50@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)I.e. Not the OS.js installation.
16:10:53@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) (edited) I.e. Not the ... => I.e. not the ...
16:14:02@gitter_alberkko:matrix.orgalberkko (Gitter) at \OS.js\src\packages
16:14:14@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) OS.js/src/packages/<package>
16:22:43@gitter_alberkko:matrix.orgalberkko (Gitter) oh okay, I actually tried that before but I was getting a webpack error, then i remembered that i needed to install npm also inside the package. It's okay now, thank you very much.
16:22:55@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter):ok_hand:
16:23:22@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)FYI: The settings app was updated this weekend, so might wanna take a pull there :)
16:38:18@gitter_alberkko:matrix.orgalberkko (Gitter)Yeah I noticed earlier actually, but how can you make icons appear in the desktop though?
16:40:35@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)Enable iconview via settings app.
16:40:49@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)Now you can drop stuff there via ex filemanager.
16:42:19@gitter_alberkko:matrix.orgalberkko (Gitter)Ahh cool, thank you
16:42:32@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) Also note some other libraries were updated to support the new stuff in settings app, so you might wanna run npm update in your installation :)
16:43:53@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)(then rebuild)
16:49:58@gitter_alberkko:matrix.orgalberkko (Gitter)Done 👍👍
27 Mar 2020
20:27:11@mortezabk:matrix.orgmortezabkhello ... I've written an app with react js executables in os-js but when using openfiledialog() it selects or uploads the file from the host (Linux ubuntu), not from the os-js daemon. constructor (props) { super(props); this.handleClick = this.handleClick.bind(this); } handleClick(e) { this.refs.fileUploader.click(); } <input type="file" id="file" ref="fileUploader" style={{display: "none"}}/> Is there a component (such as fileuploader ) in this field to upload the file from osjs VM, not from the host? and How to use it?
20:30:37@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)If I understand you correctly, you want to open a dialog to select a file that is stored in the OS.js VFS ?
20:31:19@mortezabk:matrix.orgmortezabkexactly
20:36:53@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter)

There's no component for that, but you could just write a function for it:

const createFileDialog = (cb) core.make('osjs/dialog', 'file', {}, (btn, file) => {
  if (button === 'ok') {
    cb(file);
  }
});

Then you can for example use that to read the file:

createFileDialog(file => {
  const text = await core.make('osjs/vfs').readfile(file); // Use ex "(file, 'blob')" if you need binary
  console.log(text);
});
20:37:15@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) (edited) ... 'file', {}, (btn, ... => ... 'file', {type: 'open'}, (btn, ...
20:37:34@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) (edited) ... (cb) core.make('osjs/dialog', ... => ... (cb) => core.make('osjs/dialog', ...
20:38:27@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) (edited) ... if (button === ... => ... if (btn === ...
20:48:41@mortezabk:matrix.orgmortezabk Thx Anders Evenrud (Gitter)
20:49:14@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter):+1:
23:02:40@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) @mortezabk Here's a complete example using React Context: https://codesandbox.io/s/osjs-react-context-example-056ul which is how I'd probably handle this :)
23:02:54@gitter_andersevenrud:matrix.orgAnders Evenrud (Gitter) The relevant part is the "package" directory you see there.
28 Mar 2020
06:57:02@mortezabk:matrix.orgmortezabk Thx again Anders Evenrud (Gitter)

There are no newer messages yet.


Back to Room List