Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,21 @@ var quitting = false
* we check if it's already running and if it is we focus the existing window
* rather than opening a new instance.
*/
function quitIfAlreadyRunning() {
var shouldQuit = electron.app.makeSingleInstance(function(commandLine, workingDirectory) {
function quitIfAlreadyRunning () {
var shouldQuit = electron.app.makeSingleInstance(function (commandLine, workingDirectory) {
// Someone tried to run a second instance, we should focus our window.
if (windows.main) {
if (windows.main.isMinimized()) windows.main.restore();
windows.main.focus();
if (windows.main.isMinimized()) windows.main.restore()
windows.main.focus()
}
});
})

if (shouldQuit) {
electron.app.quit();
return;
electron.app.quit()
}
}

quitIfAlreadyRunning();
quitIfAlreadyRunning()

electron.app.on('ready', () => {
setupContext('ssb', {
Expand Down
152 changes: 57 additions & 95 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"Publishing...": "Publishing...",
"Publish Privately": "Publish Privately",
"Publish": "Publish",
"Welcome to Patchwork": "Welcome to Patchwork",
"You may not be able to see new content until you follow some users or pubs.": "You may not be able to see new content until you follow some users or pubs.",
"For help, see the 'Getting Started' guide at ": "For help, see the 'Getting Started' guide at ",
"You are not following anyone": "You are not following anyone",
"For help getting started, see the guide at ": "For help getting started, see the guide at ",
"Nobody will be able to see your posts until you have a follower. The easiest way to get a follower is to use a pub invite as the pub will follow you back. If you have already redeemed a pub invite and you see it has not followed you back on your profile, try another pub.": "Nobody will be able to see your posts until you have a follower. The easiest way to get a follower is to use a pub invite as the pub will follow you back. If you have already redeemed a pub invite and you see it has not followed you back on your profile, try another pub.",
"You have no followers": "You have no followers",
"update": "update",
"updates": "updates",
"+ Join Pub": "+ Join Pub",
Expand All @@ -13,12 +15,12 @@
"Local": "Local",
"Connected Pubs": "Connected Pubs",
"Who to follow": "Who to follow",
"Write a private message": "Write a private message \n\n\n\nThis can only be read by yourself and people you have @mentioned.",
"Write a private message": "Write a private message",
"Edit Your Profile": "Edit Your Profile",
"Public key for this profile": "Public key for this profile",
"This person is blocked by %s of your friends.": {
"one": "This person is blocked by %s of your friends.",
"other": "This person is blocked by %s of your friends."
"one": "This person is blocked by %s of your friends.",
"other": "This person is blocked by %s of your friends."
},
"You don't follow anyone who follows this person": "You don't follow anyone who follows this person",
"You might not be seeing their latest messages. You could try joining a pub that they are a member of.": "You might not be seeing their latest messages. You could try joining a pub that they are a member of.",
Expand All @@ -29,13 +31,13 @@
"However, since you follow someone that follows them, you should be able to see their latest posts.": "However, since you follow someone that follows them, you should be able to see their latest posts.",
"Mutual Friends": "Mutual Friends",
"You share %s mutual friends with this person.": {
"one": "You share %s mutual friend with this person.",
"other": "You share %s mutual friends with this person."
"one": "You share %s mutual friends with this person.",
"other": "You share %s mutual friends with this person."
},
"Followed by": "Followed by",
"You follow %s people that follow this person.": {
"one": "You follow someone that follows this person.",
"other": "You follow %s people that follow this person."
"one": "You follow %s people that follow this person.",
"other": "You follow %s people that follow this person."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why these changes were made. It is overriding the custom strings with default ones. I will attempt to roll these back before merging. Hopefully my git foo is strong enough!!

},
"Send Private Message": "Send Private Message",
"Friends": "Friends",
Expand All @@ -58,128 +60,88 @@
"Mentions": "Mentions",
" has been released.": " has been released.",
" Click here to download and view more info!": " Click here to download and view more info!",
"Force Disconnect": "Force Disconnect",
"View %s more": {
"one": "View %s more",
"other": "View %s more"
},
"Self Assigned": "Self Assigned",
"Assigned By": "Assigned By",
"followed ": "followed ",
"from now": "from now",
"ago": "ago",
"years": "years",
"months": "months",
"weeks": "weeks",
"days": "days",
"hours": "hours",
"minutes": "mins",
"seconds": "secs",
"minutes": "minutes",
"seconds": "seconds",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these lines related to the purpose of this change?

"year": "year",
"month": "month",
"week": "week",
"day": "day",
"hour": "hour",
"minute": "min",
"second": "sec",
"minute": "minute",
"second": "second",
"Liked by": "Liked by",
"likes": "likes",
"See less": "See less",
"See more": "See more",
"Reply": "Reply",
"mentioned you": "mentioned you",
"View full thread": "View full thread",
"Unsubscribe": "Unsubscribe",
"Subscribe": "Subscribe",
"Force Disconnect": "Force Disconnect",
"(you)": "(you)",
"replied to this message": "replied to this message",
"in reply to ": "in reply to ",
"See less": "See less",
"See more": "See more",
"mentioned you": "mentioned you",
"mentioned in your network": "mentioned in your network",
"followed ": "followed ",
" referenced this message:": " referenced this message:",
"added changes": "added changes",
" and ": " and ",
"Liked by": "Liked by",
"likes": "likes",
"liked this message": "liked this message",
"like": "like",
"replied to this message": "replied to this message",
"%s people from your network replied to this message on ": {
"one": "%s people from your network replied to this message on ",
"other": "%s people from your network replied to this message on "
},
"unfollowed ": "unfollowed ",
" others": " others",
"subscribed to ": "subscribed to ",
"Write a public message": "Write a public message",
"New Message": "New Message",
"%s people from your network replied to this message on ": {
"one": "%s person from your network replied to this message on ",
"other": "%s people from your network replied to this message on "
"Click to unsubscribe": "Click to unsubscribe",
"Subscribed": "Subscribed",
"Subscribe": "Subscribe",
"You follow %s people that subscribe to this channel.": {
"one": "You follow %s people that subscribe to this channel.",
"other": "You follow %s people that subscribe to this channel."
},
"mentioned in your network": "mentioned in your network",
"Channels": "Channels",
"Browse All": "Browse All",
"$name": "English",
"Theme": "Theme",
"Language": "Language",
"Default": "Default",
"de": "German",
"en": "en",
"es": "Spanish",
"ki": "Kashmiri",
"pt": "pt",
"pt-BR": "Brazillian Portuguese",
"Public Feed Options": "Public Feed Options",
"Hide following messages": "Hide following messages",
"This is you.": "This is you.",
"Write a message in this channel": "Write a message in this channel",
"You may not be able to see new channel content until you follow some users or pubs.": "You may not be able to see new channel content until you follow some users or pubs.",
"mentioned this channel": "mentioned this channel",
" others": " others",
"Click to unblock": "Click to unblock",
"Blocked": "Blocked",
"Click to unfollow": "Click to unfollow",
"Follow Back": "Follow Back",
"Follow": "Follow",
"Click to block syncing with this person and hide their posts": "Click to block syncing with this person and hide their posts",
"Block": "Block",
"This is you.": "This is you.",
"assigned a display image to ": "assigned a display image to ",
"Close": "Close",
"self identifies as ": "self identifies as ",
"New Message": "New Message",
"Write a private reply": "Write a private reply",
"Write a public reply": "Write a public reply",
"External Link": "External Link",
"subscribed to ": "subscribed to ",
"unsubscribed from ": "unsubscribed from ",
"Click to unsubscribe": "Click to unsubscribe",
"Subscribed": "Subscribed",
"Write a message in this channel": "Write a message in this channel\n\n\n\nPeople who follow you or subscribe to this channel will also see this message in their main feed.\n\nTo create a new channel, type the channel name (preceded by a #) into the search box above. e.g #cat-pics",
"mentioned this channel": "mentioned this channel",
"You may not be able to see new channel content until you follow some users or pubs.": "You may not be able to see new channel content until you follow some users or pubs.",
"self assigned a description": "self assigned a description",
"liked this message": "liked this message",
"Confirm": "Confirm",
"Cancel": "Cancel",
"self assigned a display image": "self assigned a display image",
"Search Results:": "Search Results:",
"Search completed.": "Search completed.",
"result found": "result found",
"results found": "results found",
"blocked ": "blocked ",
"Confirm": "Confirm",
"Cancel": "Cancel",
"Unread Message": "Unread Message",
"Font Size": "Font Size",
"Hide posts in channels that are not subscribed": "Hide posts in channels that are not subscribed",
"Information": "Information",
"Hide channel (un)subcribe messages": "Hide channel (un)subcribe messages",
"Channel Feed Options": "Channel Feed Options",
" forked this discussion:": " forked this discussion:",
"You are not following anyone": "You are not following anyone",
"For help getting started, see the guide at ": "For help getting started, see the guide at ",
"added changes": "added changes",
"Your Profile": "Your Profile",
"Choose Profile Image...": "Choose Profile Image...",
"Choose a name": "Choose a name",
"Describe yourself (if you want)": "Describe yourself (if you want)",
"Missing message": "Missing message",
" via ": " via ",
"The author of this message could be outside of your follow range or they may be blocked.": "The author of this message could be outside of your follow range or they may be blocked.",
"Close": "Close",
" referenced this message:": " referenced this message:",
"on ": "on ",
"You follow %s people that subscribe to this channel.": {
"one": "You follow %s person that subscribes to this channel.",
"other": "You follow %s people that subscribe to this channel."
},
"People you follow that subscribe to this channel": "People you follow that subscribe to this channel",
" from your extended network": " from your extended network",
"+ Add Gathering": "+ Add Gathering",
"View %s more": {
"one": "View %s more",
"other": "View %s more"
},
"self identifies as ": "self identifies as ",
"self assigned a description": "self assigned a description",
"self assigned a display image": "self assigned a display image",
"assigned a display image to ": "assigned a display image to ",
"Browse Channels": "Browse Channels",
"identifies ": "identifies ",
" as \"": " as \"",
"unblocked ": "unblocked ",
"identified ": "identified ",
"All Posts from Your ": "All Posts from Your "
}
"External Link": "External Link"
}
28 changes: 21 additions & 7 deletions modules/feed/html/follow-warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,34 @@ exports.needs = nest({
})

exports.gives = nest({
'feed.html.followWarning': true
'feed.html.followWarning': true,
'feed.html.followerWarning': true
})

exports.create = function (api) {
const i18n = api.intl.sync.i18n
return nest('feed.html.followWarning', function warning (condition, explanation) {
var content = h('div', {classList: 'NotFollowingAnyoneWarning'}, h('section', [
h('h1', i18n('You are not following anyone')),
return nest('feed.html', {
followWarning: function followWarning (condition, explanation) {
return renderWarningBox(condition, i18n('You are not following anyone'), explanation)
},
followerWarning: function followerWarning (condition, explanation) {
return renderWarningBox(condition, i18n('You have no followers'), explanation)
}
})

function renderWarningBox (condition, header, explanation) {
var content = h('div', {
classList: 'NotFollowingAnyoneWarning'
}, h('section', [
h('h1', header),
h('p', explanation),
h('p', [i18n('For help getting started, see the guide at '),
h('a', {href: 'https://scuttlebutt.nz/getting-started.html'}, 'https://scuttlebutt.nz/getting-started.html')]
)
h('a', {
href: 'https://scuttlebutt.nz/getting-started.html'
}, 'https://scuttlebutt.nz/getting-started.html')
])
]))

return when(condition, content)
})
}
}
27 changes: 23 additions & 4 deletions modules/page/html/render/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ exports.needs = nest({
'progress.html.peer': 'first',

'feed.html.followWarning': 'first',
'feed.html.followerWarning': 'first',
'feed.html.rollup': 'first',
'profile.obs.recentlyUpdated': 'first',
'profile.obs.contact': 'first',
Expand Down Expand Up @@ -63,7 +64,8 @@ exports.create = function (api) {

var prepend = [
api.message.html.compose({ meta: { type: 'post' }, placeholder: i18n('Write a public message') }),
noVisibleNewPostsWarning()
noVisibleNewPostsWarning(),
noFollowersWarning()
]

var lastMessage = null
Expand Down Expand Up @@ -263,15 +265,32 @@ exports.create = function (api) {
}

function noVisibleNewPostsWarning () {
var explanation = i18n('You may not be able to see new content until you follow some users or pubs.')
const explanation = i18n('You may not be able to see new content until you follow some users or pubs.')

var shownWhen = computed([loading, contact.isNotFollowingAnybody],
const shownWhen = computed([loading, contact.isNotFollowingAnybody],
(isLoading, isNotFollowingAnybody) => !isLoading && isNotFollowingAnybody
)
)

return api.feed.html.followWarning(shownWhen, explanation)
}

function noFollowersWarning () {
const explanation = i18n(
'Nobody will be able to see your posts until you have a follower. The easiest way to get a follower is to use a pub invite as the pub will follow you back. If you have already redeemed a pub invite and you see it has not followed you back on your profile, try another pub.'
)

// We only show this if the user has followed someone as the first warning ('You are not following anyone')
// should be sufficient to get the user to join a pub. However, pubs have been buggy and not followed back on occassion.
// Additionally, someone onboarded on a local network might follow someone on the network, but not be followed back by
// them, so we begin to show this warning if the user has followed someone, but has no followers.
const shownWhen = computed([loading, contact.hasNoFollowers, contact.isNotFollowingAnybody],
(isLoading, hasNoFollowers, isNotFollowingAnybody) =>
!isLoading && (hasNoFollowers && !isNotFollowingAnybody)
)

return api.feed.html.followerWarning(shownWhen, explanation)
}

function subscribe (id) {
api.message.async.publish({
type: 'channel',
Expand Down
5 changes: 5 additions & 0 deletions modules/profile/obs/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ exports.create = function (api) {
return sync && (!following || !following.length)
})

var hasNoFollowers = computed(followers, followersList => {
return sync && (!followersList || !followersList.length)
})

return {
followers,
following,
Expand All @@ -65,6 +69,7 @@ exports.create = function (api) {
incomingViaCount: count(incomingVia),
hasOutgoing,
isNotFollowingAnybody,
hasNoFollowers,
noOutgoing: not(hasOutgoing, isYou),
hasIncoming,
noIncoming: not(hasIncoming, isYou),
Expand Down