switch between pages Code

We have a problem with Wix’s code. we get into this domain - puremagics.com We have prepared a code that will switch between pages,
in the editor it works well, but when publish its does not work.
It is in the benefit section
When you click on “heart,” it should lead to a text on a
“heart” on another page, but actually move to another page,
and so on in all the icons.

This is the code:

page preview
import {session} from ‘wix-storage’;
function GetItemIdSetSession (event) {
let item = event.target.id ;
page after
import {session} from ‘wix-storage’;
var result = ‘’;
function GetDataFromHomePage(){
result = session.getItem(‘item_key’); //Where result will be a string.
function ShowActiveTab(){
if (!result){
} else {

Does anyone know why this happens, and can help me?