mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: fix get general setting
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user