Skip to content

Commit

Permalink
Resolve #4125
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Nov 15, 2022
1 parent ddb2da3 commit 17d7bf8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
3 changes: 2 additions & 1 deletion locales/en-US.yml
Expand Up @@ -122,6 +122,7 @@ common:
noteReactions: "Reacted notes"
poll_finished: "Poll finished"
flush: "Clear cache"
signinOrUsePostUrl: "To do so, either signin or put the URL into your instance's search box and do it."
permissions:
"read:account": "View your account information"
"write:account": "Edit your account information"
Expand Down Expand Up @@ -1826,7 +1827,7 @@ common/views/components/follow-button.vue:
follow-processing: "Processing"
follow-request: "Follow request"
remoteFollow: "Remote follow"
remoteFollowMessage: "Enter the following account in the search box of the instance you want to follow and follow.\n```\n{acct}\n```\n\n\nAlternatively, enter the account you want to follow below."
remoteFollowMessage: "Enter the following URL in the search box of the instance you want to follow and follow.\n{acct}"
mobile/views/components/note.vue:
private: "This post is private"
deleted: "This post has been deleted"
Expand Down
3 changes: 2 additions & 1 deletion locales/ja-JP.yml
Expand Up @@ -124,6 +124,7 @@ common:
noteReactions: "リアクションした投稿"
poll_finished: "アンケートが完了しました"
flush: "キャッシュをクリア"
signinOrUsePostUrl: "それをするにはサインインするかURLをあなたのインスタンスの検索ボックスに入れてやっていってください。"

permissions:
"read:account": "アカウントの情報を見る"
Expand Down Expand Up @@ -2013,7 +2014,7 @@ common/views/components/follow-button.vue:
follow-processing: "フォロー処理中"
follow-request: "フォロー申請"
remoteFollow: "リモートフォロー"
remoteFollowMessage: "以下のアカウントをフォローしたいインスタンスの検索ボックスに入れてフォローして下さい\n```\n{acct}\n```\n\n\nまたは、以下にフォローしたいアカウントを入力して下さい。"
remoteFollowMessage: "以下のURLをあなたのインスタンスの検索ボックスに入れてフォローして下さい\n{acct}"

mobile/views/components/note.vue:
private: "この投稿は非公開です"
Expand Down
20 changes: 20 additions & 0 deletions src/client/app/common/scripts/note-mixin.ts
Expand Up @@ -126,6 +126,11 @@ export default (opts: Opts = {}) => ({
},

reply(viaKeyboard = false) {
if (!this.$store.getters.isSignedIn) {
this.$root.dialog({ type: 'info', text: this.$t('@.signinOrUsePostUrl') });
return;
}

this.$root.$post({
reply: this.appearNote,
animation: !viaKeyboard,
Expand All @@ -136,6 +141,11 @@ export default (opts: Opts = {}) => ({
},

renote(viaKeyboard = false) {
if (!this.$store.getters.isSignedIn) {
this.$root.dialog({ type: 'info', text: this.$t('@.signinOrUsePostUrl') });
return;
}

this.$root.$post({
renote: this.appearNote,
animation: !viaKeyboard,
Expand All @@ -152,6 +162,11 @@ export default (opts: Opts = {}) => ({
},

react(viaKeyboard = false) {
if (!this.$store.getters.isSignedIn) {
this.$root.dialog({ type: 'info', text: this.$t('@.signinOrUsePostUrl') });
return;
}

this.blur();
const w = this.$root.new(MkReactionPicker, {
source: this.$refs.reactButton,
Expand Down Expand Up @@ -208,6 +223,11 @@ export default (opts: Opts = {}) => ({
},

menu(viaKeyboard = false) {
if (!this.$store.getters.isSignedIn) {
this.$root.dialog({ type: 'info', text: this.$t('@.signinOrUsePostUrl') });
return;
}

if (this.openingMenu) return;
this.openingMenu = true;
const w = this.$root.new(MkNoteMenu, {
Expand Down
14 changes: 3 additions & 11 deletions src/client/app/common/views/components/follow-button.vue
Expand Up @@ -97,20 +97,12 @@ export default Vue.extend({
try {
if (!this.$store.getters.isSignedIn) {
const { canceled, result: acct } = await this.$root.dialog({
const uri = `${url}/@${this.user.username}`;
await this.$root.dialog({
type: 'info',
text: this.$t('remoteFollowMessage', { acct: `@${this.user.username}@${host}` }),
input: {
placeholder: 'user@example.com',
}
text: this.$t('message', { acct: `[${uri}](${uri})` }),
});
if (canceled || !acct) return;
const res = await this.$root.api('ap/interact', { acct });
const template = res.template as string;
location.href = template.replace('{uri}', `${url}/users/${this.user.id}`);
return;
}
Expand Down

0 comments on commit 17d7bf8

Please sign in to comment.