Skip to content

Commit

Permalink
[200ok-ch#932] Some more changes to organice
Browse files Browse the repository at this point in the history
  • Loading branch information
ieugen committed Jan 9, 2023
1 parent bca35e6 commit a35c6e9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
3 changes: 3 additions & 0 deletions src/actions/sync_backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export const signOut = () => (dispatch, getState) => {
persistField('gitLabProject', null);
createGitlabOAuth().reset();
break;
case 'AndroidStorage':
persistField('orgDirectory', null);
break;
default:
}

Expand Down
29 changes: 18 additions & 11 deletions src/components/SyncServiceSignIn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,27 +172,34 @@ function AndroidStorage() {
<form
onSubmit={(event) => {
event.preventDefault();
pickDirectory().then(result => {
const {uri} = result
persistField('authenticatedSyncService', 'AndroidStorage');
persistField('orgDirectory', uri);
})
window.location = window.location.origin + '?android';
persistField('authenticatedSyncService', 'AndroidStorage');
persistField('orgDirectory', orgDirectory);
window.location = window.location + '?path=org';
}}
>
<div>
<p>
<label htmlFor="input-org-dir">Org directory:</label>
<input
id="input-org-dir"
name="orgDir"
type="text"
name="url"
type="url"
value={orgDirectory}
className="textfield"
readOnly
onChange={(e) => setOrgDirectory(e.target.value)}
/>
</p>
<input type="submit" value="Use directory" />
<button
id="org-pick-directory"
name="orgDir"
onClick={(event) => {
event.preventDefault();
pickDirectory().then(result => {
const {uri} = result
setOrgDirectory(uri)
})
}}>Choose org dir</button>
</div>
<input type="submit" value="Use selected directory" />
</form>
</>
)}
Expand Down
4 changes: 1 addition & 3 deletions src/sync_backend_clients/android_sync_backend_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ export const filterAndSortDirectoryListing = (listing) => {
});
};

export default (uri) => {
// TODO: request/check permissions for file during signIn?!
let uri = uri;
export default () => {
const isSignedIn = () =>
new Promise((resolve) => resolve(true));

Expand Down

0 comments on commit a35c6e9

Please sign in to comment.