chore: fix get general setting

pull/2998/head
Steven 1 year ago
parent 80b64c02fd
commit 50a3af3b29

@ -7,7 +7,7 @@ import (
"github.com/pkg/errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/encoding/protojson"
apiv2pb "github.com/usememos/memos/proto/gen/api/v2"
storepb "github.com/usememos/memos/proto/gen/store"
@ -60,7 +60,7 @@ func (s *APIV2Service) GetWorkspaceGeneralSetting(ctx context.Context) (*storepb
}
workspaceGeneralSetting := &storepb.WorkspaceGeneralSetting{}
if workspaceSetting != nil {
if err := proto.Unmarshal([]byte(workspaceSetting.Value), workspaceGeneralSetting); err != nil {
if err := protojson.Unmarshal([]byte(workspaceSetting.Value), workspaceGeneralSetting); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal workspace setting")
}
}

@ -9,7 +9,7 @@ const Spoiler: React.FC<Props> = ({ content }: Props) => {
const [isRevealed, setIsRevealed] = useState(false);
return (
<div
<span
className={classNames(
"inline cursor-pointer select-none transition-all",
isRevealed ? "bg-gray-100 dark:bg-zinc-700" : "bg-gray-200 dark:bg-zinc-600",
@ -17,7 +17,7 @@ const Spoiler: React.FC<Props> = ({ content }: Props) => {
onClick={() => setIsRevealed(!isRevealed)}
>
<span className={classNames(isRevealed ? "opacity-100" : "opacity-0")}>{content}</span>
</div>
</span>
);
};

Loading…
Cancel
Save