Skip to content

Commit

Permalink
Don't show input for logged out users
Browse files Browse the repository at this point in the history
  • Loading branch information
boreq committed Oct 18, 2023
1 parent 1534022 commit 3a39758
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import axios, {AxiosResponse} from 'axios';
import {CurrentUser} from "@/dto/CurrentUser";
import {Mutation} from '@/store';
import {Mutation, State} from '@/store';
import {PublicKeys} from "@/dto/PublicKeys";
import {AddPublicKeyRequest} from "@/dto/AddPublicKeyRequest";
import {Store} from "vuex";

export class APIService {

private readonly axios = axios.create();

constructor(private store: any) {
constructor(private store: Store<State>) {
}

currentUser(): Promise<AxiosResponse<CurrentUser>> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@
You haven't added any public keys yet.
</p>
</div>
</div>

<input placeholder="npub..." v-model="npub">
<button @click="addPublicKey">Link public key</button>

<input placeholder="npub..." v-model="npub">
<button @click="addPublicKey">Link public key</button>
</div>
</div>
</template>

Expand Down Expand Up @@ -79,11 +78,11 @@ export default class HomeView extends Vue {
addPublicKey(): void {
this.apiService.addPublicKey(new AddPublicKeyRequest(this.npub))
.then(resp => {
console.log("added");
.then(response => {
console.log("added", response);
})
.catch(error => {
console.log("error");
console.log("error", error);
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion service/ports/http/frontend/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>nos-crossposting-service-frontend</title><script defer="defer" src="/js/chunk-vendors.d29f17a5.js"></script><script defer="defer" src="/js/app.efb3f865.js"></script><link href="/css/app.ddbde395.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but nos-crossposting-service-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>nos-crossposting-service-frontend</title><script defer="defer" src="/js/chunk-vendors.d29f17a5.js"></script><script defer="defer" src="/js/app.4cae8dac.js"></script><link href="/css/app.ddbde395.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but nos-crossposting-service-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions service/ports/http/frontend/js/app.4cae8dac.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion service/ports/http/frontend/js/app.efb3f865.js.map

This file was deleted.

0 comments on commit 3a39758

Please sign in to comment.