~netlandish/links-dev

links: Only show save count when it's been saved more than once. v1 APPLIED

Peter Sanchez: 1
 Only show save count when it's been saved more than once.

 1 files changed, 6 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.code.netlandish.com/~netlandish/links-dev/patches/151/mbox | git am -3
Learn more about email & git

[PATCH links] Only show save count when it's been saved more than once. Export this patch

Changelog-changed: Only show save count when the URL has been publicly
  saved more than once.
---
 models/utils.go | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/models/utils.go b/models/utils.go
index f8d787e..d4a6dfc 100644
--- a/models/utils.go
+++ b/models/utils.go
@@ -88,12 +88,14 @@ func TagsToString(t []Tag) string {
// ShowLinkCounter says whether or not to show a link counter
func ShowLinkCounter(obj any) bool {
	switch v := any(obj).(type) {
	case *BaseURL, BaseURL:
		return true
	case *BaseURL:
		return v.Counter > 1
	case BaseURL:
		return v.Counter > 1
	case *OrgLink:
		return v.BaseURLCounter > 0
		return v.BaseURLCounter > 1
	case OrgLink:
		return v.BaseURLCounter > 0
		return v.BaseURLCounter > 1
	default:
		return false
	}
-- 
2.47.2
Applied.

To git@git.code.netlandish.com:~netlandish/links
   3aff1c0..e0fbbee  master -> master