Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add official way to access $client of the file-picker #23

Open
LarsLuz opened this issue Nov 11, 2020 · 4 comments
Open

Add official way to access $client of the file-picker #23

LarsLuz opened this issue Nov 11, 2020 · 4 comments

Comments

@LarsLuz
Copy link
Contributor

LarsLuz commented Nov 11, 2020

The file-picker is incredible useful for integration with other apps, but currently the interaction with the underlying ownCloud is limited because the instance of the owncloud-sdk is not shared with apps that use the file-picker.

Currently the only workaround is to "steal" the instance by accessing Vue.prototype.$client. Maybe we can include an official way to retrieve the $client? For example we could include a new emitter that is called when the file-picker initially is finished with loading and sucessfully authorized itself against the ownCloud.

@LukasHirt
Copy link
Collaborator

I was thinking about making owncloud-sdk a peer dependency. That way the project which is using it could have direct access to it and we wouldn't need to take care of passing it from within the file picker. This would also solve the issue of potential two sdk dependencies if the project already has it. Would such a solution be ok for your use case?

@LukasHirt
Copy link
Collaborator

Hmm, with the current approach peer dependencies are not going to work. As we want to be able to use the file-picker anywhere (that's why it is built as web component), we cannot depend on being able to install any deps.

@LarsLuz
Copy link
Contributor Author

LarsLuz commented Nov 30, 2020

Maybe you could reconsider my initial thought?
Currently we can add an event listener that listens for "selectResources" events. Maybe we could integrate an "onPickerReady" event that will pass the $client instance to the subscribed listeners as soon as it becomes available?

@LukasHirt
Copy link
Collaborator

LukasHirt commented Nov 30, 2020

That could be a possible approach, yes. Not much other alternatives (that would be at least a bit nice) are coming to my mind now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants