Fixed focus and minor changes

This commit is contained in:
Nathan Byrd 2023-02-03 16:14:45 -06:00
parent 95250d23f2
commit 00e6b41a3e
3 changed files with 19 additions and 8 deletions

View File

@ -472,6 +472,7 @@
BT2: { BT2: {
width: 20 width: 20
focusTextStyle: upper focusTextStyle: upper
submit: true
} }
} }
} }
@ -496,16 +497,19 @@
width: 4 width: 4
} }
MT7: { MT7: {
focus: true
width: 69 width: 69
height: 3 height: 3
mode: preview mode: preview
} }
BT8: { BT8: {
focusTextStyle: upper focusTextStyle: upper
submit: true
} }
BT9: { BT9: {
text: back text: back
focusTextStyle: upper focusTextStyle: upper
submit: true
} }
} }
} }

View File

@ -22,7 +22,7 @@ const FormIds = {
const MciViewIds = { const MciViewIds = {
main: { main: {
searchUrl: 1, searchUrl: 1,
searchOrCancel: 2, searchButton: 2,
}, },
view: { view: {
userName: 1, userName: 1,
@ -51,11 +51,8 @@ exports.getModule = class ActivityPubActorSearch extends MenuModule {
case MciViewIds.main.searchUrl: { case MciViewIds.main.searchUrl: {
return this._search(formData.value, cb); return this._search(formData.value, cb);
} }
case MciViewIds.main.searchOrCancel: { case MciViewIds.main.searchButton: {
const search = get(formData, 'value.searchOrCancel') === 0; return this._search(formData.value, cb);
return search
? this._search(formData.value, cb)
: this.prevMenu(cb);
} }
default: default:
@ -105,11 +102,20 @@ exports.getModule = class ActivityPubActorSearch extends MenuModule {
async.series( async.series(
[ [
callback => { callback => {
if (this.viewControllers.main) {
this.viewControllers.main.setFocus(false);
}
return this.displayArtAndPrepViewController( return this.displayArtAndPrepViewController(
'view', 'view',
FormIds.view, FormIds.view,
{ clearScreen: true }, { clearScreen: true },
callback (err, artInfo, wasCreated) => {
if (!err && !wasCreated) {
this.viewControllers.view.setFocus(true);
}
return callback(err);
}
); );
}, },
callback => { callback => {
@ -151,10 +157,11 @@ exports.getModule = class ActivityPubActorSearch extends MenuModule {
const summaryView = v(MciViewIds.view.summary); const summaryView = v(MciViewIds.view.summary);
summaryView.setText(htmlToMessageBody(remoteActor.summary)); summaryView.setText(htmlToMessageBody(remoteActor.summary));
summaryView.redraw();
const followButtonView = v(MciViewIds.view.followButton); const followButtonView = v(MciViewIds.view.followButton);
// TODO: FIXME: Real status // TODO: FIXME: Real status
followButtonView.setText('Follow'); followButtonView.setText('follow');
return callback(null); return callback(null);
}, },